Skip to content

Commit 2eda219

Browse files
committed
chore: Fix l-node-edtior test
1 parent 6d87a6d commit 2eda219

1 file changed

Lines changed: 17 additions & 68 deletions

File tree

packages/plugins/test/unit/editors/substation/l-node-editor.test.ts

Lines changed: 17 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -27,186 +27,135 @@ describe('web component rendering LNode element', () => {
2727
});
2828

2929
it('having a default icon for invalid lnClass groups', () => {
30-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
31-
'd',
32-
'M9,7H11V15H15V17H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
33-
);
30+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-system')).to.exist;
3431
});
3532

3633
it('with specific icon for Lxxx lnClass attribute', async () => {
3734
lNode.setAttribute('lnClass', 'Lxxx');
3835
element.element = lNode;
3936
await element.requestUpdate();
4037

41-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
42-
'd',
43-
'M9,7H11V15H15V17H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
44-
);
38+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-system')).to.exist;
4539
});
4640

4741
it('with specific icon for Axxx lnClass attribute', async () => {
4842
lNode.setAttribute('lnClass', 'Axxx');
4943
element.element = lNode;
5044
await element.requestUpdate();
5145

52-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
53-
'd',
54-
'M11,7H13A2,2 0 0,1 15,9V17H13V13H11V17H9V9A2,2 0 0,1 11,7M11,9V11H13V9H11M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2Z'
55-
);
46+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-automation')).to.exist;
5647
});
5748

5849
it('with specific icon for Cxxx lnClass attribute', async () => {
5950
lNode.setAttribute('lnClass', 'Cxxx');
6051
element.element = lNode;
6152
await element.requestUpdate();
6253

63-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
64-
'd',
65-
'M11,7H13A2,2 0 0,1 15,9V10H13V9H11V15H13V14H15V15A2,2 0 0,1 13,17H11A2,2 0 0,1 9,15V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
66-
);
54+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-control')).to.exist;
6755
});
6856

6957
it('with specific icon for Fxxx lnClass attribute', async () => {
7058
lNode.setAttribute('lnClass', 'Fxxx');
7159
element.element = lNode;
7260
await element.requestUpdate();
7361

74-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
75-
'd',
76-
'M9,7H15V9H11V11H14V13H11V17H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
77-
);
62+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-functional')).to.exist;
7863
});
7964

8065
it('with specific icon for Gxxx lnClass attribute', async () => {
8166
lNode.setAttribute('lnClass', 'Gxxx');
8267
element.element = lNode;
8368
await element.requestUpdate();
8469

85-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
86-
'd',
87-
'M11,7H15V9H11V15H13V11H15V15A2,2 0 0,1 13,17H11A2,2 0 0,1 9,15V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
88-
);
70+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-general')).to.exist;
8971
});
9072

9173
it('with specific icon for Ixxx lnClass attribute', async () => {
9274
lNode.setAttribute('lnClass', 'Ixxx');
9375
element.element = lNode;
9476
await element.requestUpdate();
9577

96-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
97-
'd',
98-
'M14,7V9H13V15H14V17H10V15H11V9H10V7H14M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
99-
);
78+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-interfacing')).to.exist;
10079
});
10180

10281
it('with specific icon for Kxxx lnClass attribute', async () => {
10382
lNode.setAttribute('lnClass', 'Kxxx');
10483
element.element = lNode;
10584
await element.requestUpdate();
10685

107-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
108-
'd',
109-
'M9,7H11V10.33L13,7H15L12,12L15,17H13L11,13.67V17H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
110-
);
86+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-nonelectrical')).to.exist;
11187
});
11288

11389
it('with specific icon for Mxxx lnClass attribute', async () => {
11490
lNode.setAttribute('lnClass', 'Mxxx');
11591
element.element = lNode;
11692
await element.requestUpdate();
11793

118-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
119-
'd',
120-
'M9,7H15A2,2 0 0,1 17,9V17H15V9H13V16H11V9H9V17H7V9A2,2 0 0,1 9,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
121-
);
94+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-measurement')).to.exist;
12295
});
12396

12497
it('with specific icon for Pxxx lnClass attribute', async () => {
12598
lNode.setAttribute('lnClass', 'Pxxx');
12699
element.element = lNode;
127100
await element.requestUpdate();
128101

129-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
130-
'd',
131-
'M9,7H13A2,2 0 0,1 15,9V11A2,2 0 0,1 13,13H11V17H9V7M11,9V11H13V9H11M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
132-
);
102+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-protection')).to.exist;
133103
});
134104

135105
it('with specific icon for Qxxx lnClass attribute', async () => {
136106
lNode.setAttribute('lnClass', 'Qxxx');
137107
element.element = lNode;
138108
await element.requestUpdate();
139109

140-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
141-
'd',
142-
'M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M11,7H13A2,2 0 0,1 15,9V15A2,2 0 0,1 13,17V19H11V17A2,2 0 0,1 9,15V9A2,2 0 0,1 11,7M11,9V15H13V9H11Z'
143-
);
110+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-quality')).to.exist;
144111
});
145112

146113
it('with specific icon for Rxxx lnClass attribute', async () => {
147114
lNode.setAttribute('lnClass', 'Rxxx');
148115
element.element = lNode;
149116
await element.requestUpdate();
150117

151-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
152-
'd',
153-
'M9,7H13A2,2 0 0,1 15,9V11C15,11.84 14.5,12.55 13.76,12.85L15,17H13L11.8,13H11V17H9V7M11,9V11H13V9H11M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,16.41 7.58,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
154-
);
118+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-protectionrelated')).to.exist;
155119
});
156120

157121
it('with specific icon for Sxxx lnClass attribute', async () => {
158122
lNode.setAttribute('lnClass', 'Sxxx');
159123
element.element = lNode;
160124
await element.requestUpdate();
161125

162-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
163-
'd',
164-
'M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
165-
);
126+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-supervision')).to.exist;
166127
});
167128

168129
it('with specific icon for Txxx lnClass attribute', async () => {
169130
lNode.setAttribute('lnClass', 'Txxx');
170131
element.element = lNode;
171132
await element.requestUpdate();
172133

173-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
174-
'd',
175-
'M9,7H15V9H13V17H11V9H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
176-
);
134+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-transformer')).to.exist;
177135
});
178136

179137
it('with specific icon for Xxxx lnClass attribute', async () => {
180138
lNode.setAttribute('lnClass', 'Xxxx');
181139
element.element = lNode;
182140
await element.requestUpdate();
183141

184-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
185-
'd',
186-
'M9,7H11L12,9.5L13,7H15L13,12L15,17H13L12,14.5L11,17H9L11,12L9,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
187-
);
142+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-switchgear')).to.exist;
188143
});
189144

190145
it('with specific icon for Yxxx lnClass attribute', async () => {
191146
lNode.setAttribute('lnClass', 'Yxxx');
192147
element.element = lNode;
193148
await element.requestUpdate();
194149

195-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
196-
'd',
197-
'M9,7H11L12,10L13,7H15L13,13V17H11V13L9,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
198-
);
150+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-powertransformer')).to.exist;
199151
});
200152

201153
it('with specific icon for Zxxx lnClass attribute', async () => {
202154
lNode.setAttribute('lnClass', 'Zxxx');
203155
element.element = lNode;
204156
await element.requestUpdate();
205157

206-
expect(element.shadowRoot?.querySelector('path')).to.have.attribute(
207-
'd',
208-
'M9,7H15V9L11,15H15V17H9V15L13,9H9V7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z'
209-
);
158+
expect(element.shadowRoot?.querySelector('custom-icon-lnode-furtherpowersystemequipment')).to.exist;
210159
});
211160
});
212161

0 commit comments

Comments
 (0)