diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Tests')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js index 314ec0599c..7b2385ab2e 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js @@ -58,4 +58,19 @@ describe("correct behavior", () => { expect(es419.of("AA")).toBe("AA"); expect(zhHant.of("AA")).toBe("AA"); }); + + test("option type script", () => { + const en = new Intl.DisplayNames("en", { type: "script" }); + expect(en.of("Latn")).toBe("Latin"); + + const es419 = new Intl.DisplayNames("es-419", { type: "script" }); + expect(es419.of("Latn")).toBe("latรญn"); + + const zhHant = new Intl.DisplayNames(["zh-Hant"], { type: "script" }); + expect(zhHant.of("Latn")).toBe("ๆไธๆ"); + + expect(en.of("Aaaa")).toBe("Aaaa"); + expect(es419.of("Aaaa")).toBe("Aaaa"); + expect(zhHant.of("Aaaa")).toBe("Aaaa"); + }); }); |