From 06a5683d937105faf54793ce4f63f8a2ed03b23d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 6 Sep 2024 15:44:49 -0500 Subject: [PATCH] chore(developer): unboxing fix for displays Fixes: #12208 --- .../src/types/ldml-keyboard/ldml-keyboard-xml-reader.ts | 6 ++++++ developer/src/kmc-ldml/test/test-disp.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/developer/src/common/web/utils/src/types/ldml-keyboard/ldml-keyboard-xml-reader.ts b/developer/src/common/web/utils/src/types/ldml-keyboard/ldml-keyboard-xml-reader.ts index 3732238d495..baa6f43929d 100644 --- a/developer/src/common/web/utils/src/types/ldml-keyboard/ldml-keyboard-xml-reader.ts +++ b/developer/src/common/web/utils/src/types/ldml-keyboard/ldml-keyboard-xml-reader.ts @@ -61,6 +61,12 @@ export class LDMLKeyboardXMLSourceFileReader { if (!source.keyboard3.forms.import) { source.keyboard3.forms.import = []; } + if (!source.keyboard3.displays) { + source.keyboard3.displays = { + display: [], + displayOptions: {}, + }; + } } boxXmlArray(source?.keyboard3, 'layers'); boxXmlArray(source?.keyboard3?.displays, 'display'); diff --git a/developer/src/kmc-ldml/test/test-disp.ts b/developer/src/kmc-ldml/test/test-disp.ts index 36f08f2780a..1ffe682191a 100644 --- a/developer/src/kmc-ldml/test/test-disp.ts +++ b/developer/src/kmc-ldml/test/test-disp.ts @@ -12,7 +12,7 @@ describe('disp', function () { it('should compile minimal disp', async function() { let disp = await loadSectionFixture(DispCompiler, 'sections/disp/minimal.xml', compilerTestCallbacks) as Disp; - assert.equal(compilerTestCallbacks.messages.length, 0); + assert.sameDeepMembers(compilerTestCallbacks.messages, []); assert.ok(disp?.disps); assert.equal(disp.disps.length, 0);