Skip to content

Commit 7dc197f

Browse files
committed
chore: Fix more tests
1 parent 2eda219 commit 7dc197f

5 files changed

Lines changed: 26 additions & 12 deletions

File tree

packages/plugins/test/integration/editors/templates/dotype-wizarding.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ describe('DOType wizards', () => {
152152
selector.value = 'OpenSCD_ENS_Health';
153153
idField.maybeValue = 'myENSHealth';
154154
await parent.requestUpdate();
155+
await new Promise(resolve => setTimeout(resolve, 0));
155156
primayAction.click();
156157
await parent.updateComplete;
157158
expect(doc.querySelector('DOType[id="myENSHealth"]')).to.exist;
@@ -167,6 +168,7 @@ describe('DOType wizards', () => {
167168
selector.value = 'OpenSCD_MV_int';
168169
idField.maybeValue = 'myMV';
169170
await parent.requestUpdate();
171+
await new Promise(resolve => setTimeout(resolve, 0));
170172
primayAction.click();
171173
await parent.updateComplete;
172174
expect(doc.querySelector('DAType[id="OpenSCD_AnalogueValue_INT32"]')).to

packages/plugins/test/unit/editors/templates/datype.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ describe('wizards for DAType element', () => {
6363

6464
it('as wizard input', () => expect(input).to.exist);
6565

66-
it('triggers a complex action', () => {
66+
it('triggers a complex action', async () => {
6767
input!.value = 'someTestId';
68+
await new Promise(resolve => setTimeout(resolve, 0));
6869
primaryAction.click();
6970
expect(actionEvent).to.be.calledOnce;
7071

7172
const action = actionEvent.args[0][0].detail.action;
7273
expect(action).to.not.satisfy(isSimple);
7374
});
7475

75-
it('that edits the id attribute of DAType', () => {
76+
it('that edits the id attribute of DAType', async () => {
7677
input!.value = 'someTestId';
78+
await new Promise(resolve => setTimeout(resolve, 0));
7779
primaryAction.click();
7880

7981
const complexAction = <ComplexAction>(
@@ -83,13 +85,14 @@ describe('wizards for DAType element', () => {
8385
expect(actions[0].new.element).to.have.attribute('id', 'someTestId');
8486
});
8587

86-
it('that edits all referenced lnType attribute as well', () => {
88+
it('that edits all referenced lnType attribute as well', async () => {
8789
const oldId = input?.value;
8890
const numReferences = doc.querySelectorAll(
8991
`DOType > DA[type="${oldId}"], DAType > BDA[type="${oldId}"]`
9092
).length;
9193

9294
input!.value = 'someTestId';
95+
await new Promise(resolve => setTimeout(resolve, 0));
9396
primaryAction.click();
9497

9598
const complexAction = <ComplexAction>(

packages/plugins/test/unit/editors/templates/dotype.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ describe('wizards for DOType element', () => {
6363

6464
it('as wizard input', () => expect(input).to.exist);
6565

66-
it('triggers a complex action', () => {
66+
it('triggers a complex action', async () => {
6767
input!.value = 'someTestId';
68+
await new Promise(resolve => setTimeout(resolve, 0));
6869
primaryAction.click();
6970
expect(actionEvent).to.be.calledOnce;
7071

7172
const action = actionEvent.args[0][0].detail.action;
7273
expect(action).to.not.satisfy(isSimple);
7374
});
7475

75-
it('that edits the id attribute of DOType', () => {
76+
it('that edits the id attribute of DOType', async () => {
7677
input!.value = 'someTestId';
78+
await new Promise(resolve => setTimeout(resolve, 0));
7779
primaryAction.click();
7880

7981
const complexAction = <ComplexAction>(
@@ -83,13 +85,14 @@ describe('wizards for DOType element', () => {
8385
expect(actions[0].new.element).to.have.attribute('id', 'someTestId');
8486
});
8587

86-
it('that edits all referenced lnType attribute as well', () => {
88+
it('that edits all referenced lnType attribute as well', async () => {
8789
const oldId = input?.value;
8890
const numReferences = doc.querySelectorAll(
8991
`LNodeType > DO[type="${oldId}"], DOType > SDO[type="${oldId}"]`
9092
).length;
9193

9294
input!.value = 'someTestId';
95+
await new Promise(resolve => setTimeout(resolve, 0));
9396
primaryAction.click();
9497

9598
const complexAction = <ComplexAction>(

packages/plugins/test/unit/editors/templates/enumtype.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ describe('wizards for EnumType element', () => {
6363

6464
it('as wizard input', () => expect(input).to.exist);
6565

66-
it('triggers a complex action', () => {
66+
it('triggers a complex action', async () => {
6767
input!.value = 'someTestId';
68+
await new Promise(resolve => setTimeout(resolve, 0));
6869
primaryAction.click();
6970
expect(actionEvent).to.be.calledOnce;
7071

7172
const action = actionEvent.args[0][0].detail.action;
7273
expect(action).to.not.satisfy(isSimple);
7374
});
7475

75-
it('that edits the id attribute of EnumType', () => {
76+
it('that edits the id attribute of EnumType', async () => {
7677
input!.value = 'someTestId';
78+
await new Promise(resolve => setTimeout(resolve, 0));
7779
primaryAction.click();
7880

7981
const complexAction = <ComplexAction>(
@@ -83,13 +85,14 @@ describe('wizards for EnumType element', () => {
8385
expect(actions[0].new.element).to.have.attribute('id', 'someTestId');
8486
});
8587

86-
it('that edits all referenced lnType attribute as well', () => {
88+
it('that edits all referenced lnType attribute as well', async () => {
8789
const oldId = input?.value;
8890
const numReferences = doc.querySelectorAll(
8991
`DOType > DA[type="${oldId}"], DAType > BDA[type="${oldId}"]`
9092
).length;
9193

9294
input!.value = 'someTestId';
95+
await new Promise(resolve => setTimeout(resolve, 0));
9396
primaryAction.click();
9497

9598
const complexAction = <ComplexAction>(

packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,19 @@ describe('wizards for LNodeType element', () => {
9090

9191
it('as wizard input', () => expect(input).to.exist);
9292

93-
it('triggers a complex action', () => {
93+
it('triggers a complex action', async () => {
9494
input!.value = 'someTestId';
95+
await new Promise(resolve => setTimeout(resolve, 0));
9596
primaryAction.click();
9697
expect(actionEvent).to.be.calledOnce;
9798

9899
const action = actionEvent.args[0][0].detail.action;
99100
expect(action).to.not.satisfy(isSimple);
100101
});
101102

102-
it('that edits the id attribute of LNodeType', () => {
103+
it('that edits the id attribute of LNodeType', async () => {
103104
input!.value = 'someTestId';
105+
await new Promise(resolve => setTimeout(resolve, 0));
104106
primaryAction.click();
105107

106108
const complexAction = <ComplexAction>(
@@ -110,13 +112,14 @@ describe('wizards for LNodeType element', () => {
110112
expect(actions[0].new.element).to.have.attribute('id', 'someTestId');
111113
});
112114

113-
it('that edits all referenced lnType attribute as well', () => {
115+
it('that edits all referenced lnType attribute as well', async () => {
114116
const oldId = input?.value;
115117
const numReferences = doc.querySelectorAll(
116118
`LN0[lnType="${oldId}"], LN[lnType="${oldId}"]`
117119
).length;
118120

119121
input!.value = 'someTestId';
122+
await new Promise(resolve => setTimeout(resolve, 0));
120123
primaryAction.click();
121124

122125
const complexAction = <ComplexAction>(

0 commit comments

Comments
 (0)