1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-7304] Add missing i18n keys for import errors (#8743)

* Add static error message when import fails

* Adding missing string on CLI for unassigned items

* Added missing string on setImportTarget

* fixed tests
This commit is contained in:
aj-rosado
2024-04-17 16:19:06 +01:00
committed by GitHub
parent 395f2e806e
commit 28a89ddb86
6 changed files with 31 additions and 4 deletions

View File

@@ -196,7 +196,7 @@ describe("ImportService", () => {
new Object() as FolderView,
);
await expect(setImportTargetMethod).rejects.toThrow("Error assigning target collection");
await expect(setImportTargetMethod).rejects.toThrow();
});
it("passing importTarget as null on setImportTarget throws error", async () => {
@@ -206,7 +206,7 @@ describe("ImportService", () => {
new Object() as CollectionView,
);
await expect(setImportTargetMethod).rejects.toThrow("Error assigning target folder");
await expect(setImportTargetMethod).rejects.toThrow();
});
it("passing importTarget, collectionRelationship has the expected values", async () => {

View File

@@ -432,7 +432,7 @@ export class ImportService implements ImportServiceAbstraction {
if (organizationId) {
if (!(importTarget instanceof CollectionView)) {
throw new Error("Error assigning target collection");
throw new Error(this.i18nService.t("errorAssigningTargetCollection"));
}
const noCollectionRelationShips: [number, number][] = [];
@@ -463,7 +463,7 @@ export class ImportService implements ImportServiceAbstraction {
}
if (!(importTarget instanceof FolderView)) {
throw new Error("Error assigning target folder");
throw new Error(this.i18nService.t("errorAssigningTargetFolder"));
}
const noFolderRelationShips: [number, number][] = [];