Skip to content

Commit

Permalink
fix: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trusz committed Feb 4, 2025
1 parent eef5e7b commit 09be4a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,22 +498,6 @@ snapshots["open-scd renders menu plugins passed down as props and it looks like
mwc-list-item=""
selected=""
tabindex="0"
value="http://localhost:50714/index.js"
>
<mwc-icon slot="meta">
launch
</mwc-icon>
Launcher
</mwc-check-list-item>
<mwc-check-list-item
aria-disabled="false"
class="external"
graphic="control"
hasmeta=""
left=""
mwc-list-item=""
selected=""
tabindex="-1"
value="http://localhost:8000/plugins/src/editors/IED.js"
>
<mwc-icon slot="meta">
Expand Down Expand Up @@ -1668,22 +1652,6 @@ snapshots["open-scd renders editor plugins passed down as props and it looks lik
mwc-list-item=""
selected=""
tabindex="0"
value="http://localhost:50714/index.js"
>
<mwc-icon slot="meta">
launch
</mwc-icon>
Launcher
</mwc-check-list-item>
<mwc-check-list-item
aria-disabled="false"
class="external"
graphic="control"
hasmeta=""
left=""
mwc-list-item=""
selected=""
tabindex="-1"
value="http://localhost:8000/plugins/src/editors/IED.js"
>
<mwc-icon slot="meta">
Expand Down Expand Up @@ -2838,22 +2806,6 @@ snapshots["open-scd layout looks like its snapshot"] =
mwc-list-item=""
selected=""
tabindex="0"
value="http://localhost:50714/index.js"
>
<mwc-icon slot="meta">
launch
</mwc-icon>
Launcher
</mwc-check-list-item>
<mwc-check-list-item
aria-disabled="false"
class="external"
graphic="control"
hasmeta=""
left=""
mwc-list-item=""
selected=""
tabindex="-1"
value="http://localhost:8000/plugins/src/editors/IED.js"
>
<mwc-icon slot="meta">
Expand Down
11 changes: 6 additions & 5 deletions packages/openscd/test/unit/Plugging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('OpenSCD-Plugin', () => {
});

it('stores default plugins on load', () =>{
expect(element.layout).property('editors').to.have.lengthOf(15)
expect(element.layout).property('editors').to.have.lengthOf(14)
});

it('has Locale property', async () => {
Expand Down Expand Up @@ -66,23 +66,23 @@ describe('OpenSCD-Plugin', () => {
it('disables deselected plugins', async () => {
firstEditorPlugin.click();
await element.updateComplete;
expect(element.layout).property('editors').to.have.lengthOf(14);
expect(element.layout).property('editors').to.have.lengthOf(13);
});

it('enables selected plugins', async () => {
(<HTMLElement>element.layout.pluginList.firstElementChild).click();
await element.updateComplete;
(<HTMLElement>element.layout.pluginList.firstElementChild).click();
await element.updateComplete;
expect(element.layout).property('editors').to.have.lengthOf(15);
expect(element.layout).property('editors').to.have.lengthOf(14);
});

it('resets plugins to default on reset button click', async () => {
(<HTMLElement>element.layout.pluginList.firstElementChild).click();
await element.updateComplete;
resetAction.click();
await element.updateComplete;
expect(element.layout).property('editors').to.have.lengthOf(7);
expect(element.layout).property('editors').to.have.lengthOf(6);
});

it('opens the custom plugin dialog on add button click', async () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('OpenSCD-Plugin', () => {
await name.updateComplete;
primaryAction.click();
await element.updateComplete;
expect(element.layout.editors).to.have.lengthOf(16);
expect(element.layout.editors).to.have.lengthOf(15);
});

it('adds a new menu kind plugin on add button click', async () => {
Expand Down Expand Up @@ -431,3 +431,4 @@ describe('OpenSCD-Plugin', () => {

})
});

0 comments on commit 09be4a3

Please sign in to comment.