Skip to content

Commit c959a40

Browse files
author
Dennis Labordus
committed
Added some updateComplete calls to make the tests more stable
Signed-off-by: Dennis Labordus <[email protected]>
1 parent da6b939 commit c959a40

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test/unit/menu/UpdateDescriptionSEL.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { expect, fixture, html } from '@open-wc/testing';
2-
import { SinonSpy, spy } from 'sinon';
1+
import {expect, fixture, html} from '@open-wc/testing';
2+
import {SinonSpy, spy} from 'sinon';
33

44
import '../../../src/open-scd.js';
5-
import { OpenSCD } from '../../../src/open-scd.js';
6-
import { ComplexAction, isSimple, isUpdate } from '../../../src/foundation.js';
5+
import {OpenSCD} from '../../../src/open-scd.js';
6+
7+
import {ComplexAction, isSimple, isUpdate} from '../../../src/foundation.js';
78
import UpdateDescriptionSel from '../../../src/menu/UpdateDescriptionSEL.js';
89

910
describe('Update method for desc attributes in SEL IEDs', () => {
@@ -48,10 +49,9 @@ describe('Update method for desc attributes in SEL IEDs', () => {
4849

4950
describe('working on SCL files without manufacturer SEL', () => {
5051
beforeEach(async () => {
51-
const doc = await fetch('test/testfiles/validators/zeroissues.scd')
52+
element.doc = await fetch('test/testfiles/validators/zeroissues.scd')
5253
.then(response => response.text())
5354
.then(str => new DOMParser().parseFromString(str, 'application/xml'));
54-
element.doc = doc;
5555

5656
signalList = await fetch(
5757
'test/testfiles/updatedesc/testSignalListSemicolon.csv'
@@ -71,11 +71,9 @@ describe('Update method for desc attributes in SEL IEDs', () => {
7171

7272
describe('working on SCL files containing manufacturer SEL', () => {
7373
beforeEach(async () => {
74-
const doc = await fetch('test/testfiles/updatedesc/updatedescSEL.scd')
74+
element.doc = await fetch('test/testfiles/updatedesc/updatedescSEL.scd')
7575
.then(response => response.text())
7676
.then(str => new DOMParser().parseFromString(str, 'application/xml'));
77-
78-
element.doc = doc;
7977
});
8078

8179
describe('using a semicolon separated file', () => {
@@ -98,6 +96,7 @@ describe('Update method for desc attributes in SEL IEDs', () => {
9896
?.querySelector<HTMLElement>('mwc-button[slot="primaryAction"]')!
9997
.click();
10098

99+
await parent.requestUpdate();
101100
await parent.updateComplete;
102101
expect(editorAction).to.have.been.calledOnce;
103102
expect(editorAction.args[0][0].detail.action).to.not.satisfy(isSimple);

0 commit comments

Comments
 (0)