Skip to content

Commit 08b5e2b

Browse files
author
Dennis Labordus
authored
test(general): Small improvements to some tests (openscd#1029)
* Small improvements in tests * Small improvements in tests
1 parent 48ef7ea commit 08b5e2b

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

test/integration/__snapshots__/open-scd.test.snap.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ snapshots["open-scd looks like its snapshot"] =
3333
Open project
3434
</span>
3535
</mwc-list-item>
36-
<oscd-plugina2b400fc5f053cb1 class="plugin">
36+
<oscd-plugina2b400fc5f053cb1 class="menu plugin">
3737
</oscd-plugina2b400fc5f053cb1>
3838
<mwc-list-item
3939
aria-disabled="false"
@@ -50,7 +50,7 @@ snapshots["open-scd looks like its snapshot"] =
5050
New project
5151
</span>
5252
</mwc-list-item>
53-
<oscd-plugin679d81826289fb9a class="plugin">
53+
<oscd-plugin679d81826289fb9a class="menu plugin">
5454
</oscd-plugin679d81826289fb9a>
5555
<mwc-list-item
5656
aria-disabled="true"
@@ -68,7 +68,7 @@ snapshots["open-scd looks like its snapshot"] =
6868
Save project
6969
</span>
7070
</mwc-list-item>
71-
<oscd-plugin1cb4a5367ff1f6a1 class="plugin">
71+
<oscd-plugin1cb4a5367ff1f6a1 class="menu plugin">
7272
</oscd-plugin1cb4a5367ff1f6a1>
7373
<li
7474
divider=""
@@ -124,7 +124,7 @@ snapshots["open-scd looks like its snapshot"] =
124124
Validate Schema
125125
</span>
126126
</mwc-list-item>
127-
<oscd-plugin3aa68346726da1cd class="plugin">
127+
<oscd-plugin3aa68346726da1cd class="plugin validator">
128128
</oscd-plugin3aa68346726da1cd>
129129
<mwc-list-item
130130
aria-disabled="true"
@@ -142,7 +142,7 @@ snapshots["open-scd looks like its snapshot"] =
142142
Validate Templates
143143
</span>
144144
</mwc-list-item>
145-
<oscd-plugin186320cdd626e422 class="plugin">
145+
<oscd-plugin186320cdd626e422 class="plugin validator">
146146
</oscd-plugin186320cdd626e422>
147147
<mwc-list-item
148148
aria-disabled="false"
@@ -196,7 +196,7 @@ snapshots["open-scd looks like its snapshot"] =
196196
Import IEDs
197197
</span>
198198
</mwc-list-item>
199-
<oscd-plugin4fed39e69404009b class="plugin">
199+
<oscd-plugin4fed39e69404009b class="menu plugin">
200200
</oscd-plugin4fed39e69404009b>
201201
<mwc-list-item
202202
aria-disabled="true"
@@ -214,7 +214,7 @@ snapshots["open-scd looks like its snapshot"] =
214214
Subscriber Update
215215
</span>
216216
</mwc-list-item>
217-
<oscd-plugin90bf5c90b69b347b class="plugin">
217+
<oscd-plugin90bf5c90b69b347b class="menu plugin">
218218
</oscd-plugin90bf5c90b69b347b>
219219
<mwc-list-item
220220
aria-disabled="true"
@@ -232,7 +232,7 @@ snapshots["open-scd looks like its snapshot"] =
232232
Merge Project
233233
</span>
234234
</mwc-list-item>
235-
<oscd-plugin2b4693cc19da2446 class="plugin">
235+
<oscd-plugin2b4693cc19da2446 class="menu plugin">
236236
</oscd-plugin2b4693cc19da2446>
237237
<mwc-list-item
238238
aria-disabled="true"
@@ -250,7 +250,7 @@ snapshots["open-scd looks like its snapshot"] =
250250
Update Substation
251251
</span>
252252
</mwc-list-item>
253-
<oscd-plugin2a662bacb120083f class="plugin">
253+
<oscd-plugin2a662bacb120083f class="menu plugin">
254254
</oscd-plugin2a662bacb120083f>
255255
<li
256256
divider=""
@@ -288,7 +288,7 @@ snapshots["open-scd looks like its snapshot"] =
288288
Help
289289
</span>
290290
</mwc-list-item>
291-
<oscd-plugin48ab1a46d409bed9 class="plugin">
291+
<oscd-plugin48ab1a46d409bed9 class="menu plugin">
292292
</oscd-plugin48ab1a46d409bed9>
293293
<mwc-list-item
294294
aria-disabled="true"
@@ -306,7 +306,7 @@ snapshots["open-scd looks like its snapshot"] =
306306
Show SCL History
307307
</span>
308308
</mwc-list-item>
309-
<oscd-plugina5aa56c7c6319526 class="plugin">
309+
<oscd-plugina5aa56c7c6319526 class="menu plugin">
310310
</oscd-plugina5aa56c7c6319526>
311311
<li
312312
divider=""

test/integration/open-scd.test.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
1-
import { html, fixture, expect } from '@open-wc/testing';
1+
import { expect, fixture, html } from '@open-wc/testing';
22

33
import '../../src/open-scd.js';
44
import { newEmptySCD } from '../../src/schemas.js';
55
import { OpenSCD } from '../../src/open-scd.js';
66

77
describe('open-scd', () => {
88
let element: OpenSCD;
9-
let invalidSCL: string;
10-
let validSCL: string;
119

1210
beforeEach(async () => {
1311
localStorage.clear();
1412

15-
invalidSCL = await fetch('/test/testfiles/invalid2007B.scd').then(
16-
response => response.text()
17-
);
18-
validSCL = await fetch('/test/testfiles/valid2007B4.scd').then(response =>
19-
response.text()
20-
);
2113
element = await fixture(html`
2214
<open-scd></open-scd>
2315
2416
<link href="public/google/fonts/roboto-v27.css" rel="stylesheet" />
2517
<link href="public/google/fonts/roboto-mono-v13.css" rel="stylesheet" />
26-
<link href="public/google/icons/material-icons-outlined.css" rel="stylesheet" />
18+
<link
19+
href="public/google/icons/material-icons-outlined.css"
20+
rel="stylesheet"
21+
/>
2722
`);
23+
await element.updateComplete;
2824
});
2925

3026
it('looks like its snapshot', async () => {
@@ -64,7 +60,7 @@ describe('open-scd', () => {
6460
expect(element.logUI).to.have.property('open', true);
6561
});
6662

67-
it('opens the diagnostics on daignostics menu entry click', async () => {
63+
it('opens the diagnostics on diagnostics menu entry click', async () => {
6864
await (<HTMLElement>(
6965
element.shadowRoot!.querySelector('mwc-list-item[iconid="rule"]')!
7066
)).click();

test/unit/Plugging.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe('PluggingElement', () => {
1919
html`<mock-plugger .doc=${doc} docName="testDoc"></mock-plugger>`
2020
)
2121
);
22+
await element.updateComplete;
2223
});
2324

2425
it('stores default plugins on load', () =>

0 commit comments

Comments
 (0)