Added localize with translations to null to delete also files

This commit is contained in:
Alexander Cerutti
2021-10-18 00:50:48 +02:00
parent 547045076a
commit 07151ec4c8
2 changed files with 23 additions and 3 deletions

View File

@@ -659,12 +659,18 @@ describe("PKPass", () => {
});
});
it("should delete a language and its all translations when null is passed as parameter", () => {
it("should delete a language, all of its translations and all of its files, when null is passed as parameter", () => {
pass.addBuffer("it.lproj/icon@3x.png", Buffer.alloc(0));
pass.addBuffer("en.lproj/icon@3x.png", Buffer.alloc(0));
pass.localize("it", null);
pass.localize("en", null);
expect(pass[localizationSymbol]["it"]).toBeUndefined();
expect(pass[localizationSymbol]["en"]).toBeUndefined();
expect(pass[filesSymbol]["it.lproj/icon@3x.png"]).toBeUndefined();
expect(pass[filesSymbol]["en.lproj/icon@3x.png"]).toBeUndefined();
});
it("should always return undefined", () => {