Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 2ffb059

Browse files
refactor: integrate scl-lib
1 parent 859f320 commit 2ffb059

File tree

5 files changed

+212
-425
lines changed

5 files changed

+212
-425
lines changed

generate-templates.ts

Lines changed: 0 additions & 333 deletions
This file was deleted.

oscd-template-generator.spec.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ describe('TemplateGenerator', () => {
5050
- PhyNam
5151
- Proxy
5252
*/
53-
expect(listener).property('args').to.have.lengthOf(5);
54-
listener.args.forEach(args => {
55-
const { edit } = args[0].detail;
53+
const edits = listener.args[0][0].detail.edit;
54+
expect(edits).to.have.lengthOf(5);
55+
edits.forEach((edit: any) => {
5656
expect(edit).to.have.property(
5757
'parent',
5858
element.doc?.querySelector('DataTypeTemplates')
@@ -66,14 +66,10 @@ describe('TemplateGenerator', () => {
6666
(element.shadowRoot?.querySelector('md-fab') as HTMLElement).click();
6767

6868
// expect one more call for the DTT section
69-
expect(listener).property('args').to.have.lengthOf(6);
70-
expect(listener.args[0][0])
71-
.property('detail')
72-
.property('edit')
73-
.to.have.property('parent', element.doc?.documentElement);
74-
expect(listener.args[0][0])
75-
.property('detail')
76-
.property('edit')
69+
const edits = listener.args[0][0].detail.edit;
70+
expect(edits).to.have.lengthOf(6);
71+
expect(edits[0]).to.have.property('parent', element.doc?.documentElement);
72+
expect(edits[0])
7773
.property('node')
7874
.to.have.property('tagName', 'DataTypeTemplates');
7975
});
@@ -133,12 +129,21 @@ describe('TemplateGenerator', () => {
133129
stVal
134130
subVal
135131
*/
136-
expect(listener).property('args').to.have.lengthOf(30);
137-
const elms = listener.args.map(args => args[0].detail.edit.node);
138-
expect(elms.filter(e => e.tagName === 'LNodeType')).to.have.lengthOf(1);
139-
expect(elms.filter(e => e.tagName === 'DOType')).to.have.lengthOf(13);
140-
expect(elms.filter(e => e.tagName === 'DAType')).to.have.lengthOf(8);
141-
expect(elms.filter(e => e.tagName === 'EnumType')).to.have.lengthOf(8);
132+
const edits = listener.args[0][0].detail.edit;
133+
expect(edits).to.have.lengthOf(30);
134+
const elms = edits.map((edit: { node: any }) => edit.node);
135+
expect(
136+
elms.filter((e: { tagName: string }) => e.tagName === 'LNodeType')
137+
).to.have.lengthOf(1);
138+
expect(
139+
elms.filter((e: { tagName: string }) => e.tagName === 'DOType')
140+
).to.have.lengthOf(13);
141+
expect(
142+
elms.filter((e: { tagName: string }) => e.tagName === 'DAType')
143+
).to.have.lengthOf(8);
144+
expect(
145+
elms.filter((e: { tagName: string }) => e.tagName === 'EnumType')
146+
).to.have.lengthOf(8);
142147
}).timeout(10000); // selecting 550 paths for a full LLN0 is rather slow.
143148
});
144149
});

0 commit comments

Comments
 (0)