Skip to content

Commit

Permalink
test: try private fn to set plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
trusz committed Feb 18, 2025
1 parent b9648e2 commit 5ed0a06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/openscd/test/unit/Plugging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function renderMockOpenSCD(
docName: string = "testDoc",
builtInPlugins: Plugin[] = builtinPlugins,
): Promise<MockOpenSCD>{

const mockHTML = html`<mock-open-scd .mockPlugins=${builtInPlugins} .doc=${doc} .docName=${docName}></mock-open-scd>`
const openscd = (await fixture(mockHTML)) as MockOpenSCD;
await openscd.updateComplete;
Expand Down Expand Up @@ -484,6 +485,8 @@ describe("Bugs ", async () => {
]
const doc = await fetchDoc()
const openscd = await renderMockOpenSCD(doc, "testDoc", plugins)
// @ts-ignore: we use the private function to arrange the scenario
openscd.storePlugins(plugins)
expect(openscd.layout.plugins).to.have.lengthOf(3, getPluginNames(openscd.layout.plugins).join(", "))

openscd.layout.pluginUI.show();
Expand Down

0 comments on commit 5ed0a06

Please sign in to comment.