Update tests

This commit is contained in:
Lucas
2018-11-10 20:57:43 +01:00
parent f96d6bb925
commit 7b887b047d
+19 -3
View File
@@ -8,11 +8,27 @@ const credentials = new kdbxweb.Credentials(
);
kdbxweb.Kdbx.load(dataarr, credentials).then(db => db);
kdbxweb.Kdbx.loadXml("data", credentials).then(db => db);
kdbxweb.Kdbx.loadXml("data", credentials).then(db => db);
const newDb = kdbxweb.Kdbx.create(credentials, 'My new db');
const group = newDb.createGroup(newDb.getDefaultGroup(), 'subgroup');
const newDb = kdbxweb.Kdbx.create(credentials, "My new db");
const defaultGroup = newDb.getDefaultGroup();
const group = newDb.createGroup(defaultGroup, "subgroup");
const anotherGroup = newDb.createGroup(group, "subgroup-2");
const yetAnotherGroup = newDb.createGroup(group, "subgroup-3");
const deepGroup = defaultGroup.groups[0].groups[0];
if (newDb.getGroup(yetAnotherGroup.uuid)){
newDb.remove(yetAnotherGroup);
}
const entry = newDb.createEntry(group);
newDb.move(entry, anotherGroup);
newDb.remove(entry);
newDb.save().then(dataAsArrayBuffer => dataAsArrayBuffer);
newDb.saveXml().then(xmlAsString => xmlAsString);
newDb.cleanup({
customIcons: true
});
newDb.upgrade();