1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

[PS 1579]kee pass2 import fails on cli (#4452)

* Fixing queryselector since the existing is failing

* Add the unit test for the keepass fix

* Adding additional test for the query.selector fix

* Fixing a lint error message
This commit is contained in:
cyprain-okeke
2023-01-19 17:12:36 +01:00
committed by GitHub
parent f4dc7ca8b4
commit fd346ba65a
3 changed files with 582 additions and 180 deletions

View File

@@ -15,7 +15,23 @@ export class KeePass2XmlImporter extends BaseImporter implements Importer {
return Promise.resolve(this.result);
}
const rootGroup = doc.querySelector("KeePassFile > Root > Group");
//Note: The doc.querySelector("KeePassFile > Root > Group") no longers works on node and we have to breakdown the query by nodes
const KeePassFileNode = doc.querySelector("KeePassFile");
if (KeePassFileNode == null) {
this.result.errorMessage = "Missing `KeePassFile` node.";
this.result.success = false;
return Promise.resolve(this.result);
}
const RootNode = KeePassFileNode.querySelector("Root");
if (RootNode == null) {
this.result.errorMessage = "Missing `KeePassFile > Root` node.";
this.result.success = false;
return Promise.resolve(this.result);
}
const rootGroup = RootNode.querySelector("Group");
if (rootGroup == null) {
this.result.errorMessage = "Missing `KeePassFile > Root > Group` node.";
this.result.success = false;