diff --git a/packages/open-scd/src/wizards/service-GSEControl.ts b/packages/open-scd/src/wizards/service-GSEControl.ts index b34c8b5606..f313a5e30b 100644 --- a/packages/open-scd/src/wizards/service-GSEControl.ts +++ b/packages/open-scd/src/wizards/service-GSEControl.ts @@ -58,6 +58,7 @@ export function createGSEControlWizardPage( ? { title: get('wizard.title.edit', { tagName: 'GSE Control' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/service-clientServer-configurations.ts b/packages/open-scd/src/wizards/service-clientServer-configurations.ts index 076929c8d6..8443c0a9d2 100644 --- a/packages/open-scd/src/wizards/service-clientServer-configurations.ts +++ b/packages/open-scd/src/wizards/service-clientServer-configurations.ts @@ -61,6 +61,7 @@ export function createClientServerConfigurationsWizardPage( ? { title: get('wizard.title.edit', { tagName: 'Client Server Services' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/service-log-settingsgroup.ts b/packages/open-scd/src/wizards/service-log-settingsgroup.ts index 398aae4bca..a74096272b 100644 --- a/packages/open-scd/src/wizards/service-log-settingsgroup.ts +++ b/packages/open-scd/src/wizards/service-log-settingsgroup.ts @@ -49,6 +49,7 @@ export function createLogSettingsGroupServicesWizardPage( ? { title: get('wizard.title.edit', { tagName: 'Services' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/service-networking.ts b/packages/open-scd/src/wizards/service-networking.ts index 6043245b57..b732eab4bf 100644 --- a/packages/open-scd/src/wizards/service-networking.ts +++ b/packages/open-scd/src/wizards/service-networking.ts @@ -61,6 +61,7 @@ export function createNetworkingWizardPage( ? { title: get('wizard.title.edit', { tagName: 'Networking' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/service-report-configurations.ts b/packages/open-scd/src/wizards/service-report-configurations.ts index 7781249f01..a5c465d73b 100644 --- a/packages/open-scd/src/wizards/service-report-configurations.ts +++ b/packages/open-scd/src/wizards/service-report-configurations.ts @@ -55,6 +55,7 @@ export function createReportConfigurationsWizardPage( ? { title: get('wizard.title.edit', { tagName: 'Report Settings' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/service-sampled-values.ts b/packages/open-scd/src/wizards/service-sampled-values.ts index d8523c73b5..70d3c850fc 100644 --- a/packages/open-scd/src/wizards/service-sampled-values.ts +++ b/packages/open-scd/src/wizards/service-sampled-values.ts @@ -60,6 +60,7 @@ export function createSampledValuesWizardPage( ? { title: get('wizard.title.edit', { tagName: 'Sampled Values' }), content: [...content], + element: services, } : null; } diff --git a/packages/open-scd/src/wizards/services.ts b/packages/open-scd/src/wizards/services.ts index b0e113d95c..73ac2b2f2d 100644 --- a/packages/open-scd/src/wizards/services.ts +++ b/packages/open-scd/src/wizards/services.ts @@ -17,7 +17,7 @@ export function isEmptyObject( return ( target === null ? [false] - : Object.keys(target).flatMap(key => { + : Object.keys(target as Object).flatMap(key => { const value: any = (target as any)[key]; if (typeof value === 'object') { return isEmptyObject(value); diff --git a/packages/open-scd/test/integration/wizards/__snapshots__/services-wizard.test.snap.js b/packages/open-scd/test/integration/wizards/__snapshots__/services-wizard.test.snap.js index 0382a08410..439d2a78f8 100644 --- a/packages/open-scd/test/integration/wizards/__snapshots__/services-wizard.test.snap.js +++ b/packages/open-scd/test/integration/wizards/__snapshots__/services-wizard.test.snap.js @@ -1,7 +1,7 @@ /* @web/test-runner snapshot v1 */ export const snapshots = {}; -snapshots["Wizards for SCL element Services define a Services wizards Wizard 1 looks like snapshot"] = +snapshots["Wizards for SCL element Services define a Services wizards Wizard 1 should look like snapshot"] = ` `; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 1 looks like snapshot */ +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 1 should look like snapshot */ -snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 looks like snapshot"] = +snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 should look like snapshot"] = ` `; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 2 looks like snapshot */ +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 2 should look like snapshot */ -snapshots["Wizards for SCL element Services define a Services wizards Wizard 3 looks like snapshot"] = +snapshots["Wizards for SCL element Services define a Services wizards Wizard 3 should look like snapshot"] = ` `; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 3 looks like snapshot */ +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 3 should look like snapshot */ + +snapshots["Wizards for SCL element Services define a Services wizards Wizard 4 should look like snapshot"] = +` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+`; +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 4 should look like snapshot */ -snapshots["Wizards for SCL element Services define a Services wizards Wizard 4 looks like snapshot"] = +snapshots["Wizards for SCL element Services define a Services wizards Wizard 5 should look like snapshot"] = ` + + `; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 4 looks like snapshot */ +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 5 should look like snapshot */ -snapshots["Wizards for SCL element Services define a Services wizards Wizard 1 should look like snapshot"] = +snapshots["Wizards for SCL element Services define a Services wizards Wizard 6 should look like snapshot"] = `
- - - Conf - - - Fix - - - + + + - - Dyn - - - Conf - - - Fix - - - + - - Dyn - - - Conf - - - Fix - - - + - - Dyn - - - Conf - - - Fix - - - + - - Dyn - - - Conf - - - Fix - - - - - + - + + + + + + + + + + + + + + + + + + +
`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 1 should look like snapshot */ +/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 6 should look like snapshot */ -snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 should look like snapshot"] = +snapshots["Wizards for SCL element Services AccessPoint wizards for Scl element Services should look like snapshot"] = `
@@ -1407,20 +1484,15 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 nullable="" > Conf Fix @@ -1431,54 +1503,16 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 label="datSet" nullable="" > - - Dyn - - - Conf - - Fix - - - - Dyn Conf @@ -1486,7 +1520,6 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 Fix @@ -1494,57 +1527,19 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 - - Dyn - - - Conf - - Fix - - - - Dyn Conf @@ -1552,7 +1547,6 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 Fix @@ -1566,15 +1560,13 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 Dyn Conf @@ -1582,7 +1574,6 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 Fix @@ -1594,20 +1585,15 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 nullable="" > Dyn Conf @@ -1615,1303 +1601,42 @@ snapshots["Wizards for SCL element Services define a Services wizards Wizard 2 Fix - + + - + + + - - - - - unbuffered - - - buffered - - - both - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
-`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 2 should look like snapshot */ - -snapshots["Wizards for SCL element Services define a Services wizards Wizard 3 should look like snapshot"] = -` -
- - - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
-`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 3 should look like snapshot */ - -snapshots["Wizards for SCL element Services define a Services wizards Wizard 4 should look like snapshot"] = -` -
- - - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Conf - - - Fix - - - - - - - - - - - - - - - - - - - - - - - - - - - unicast - - - multicast - - - both - - - - - - - - - - - - - - - - - - - - -
- - - - -
-`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 4 should look like snapshot */ - -snapshots["Wizards for SCL element Services AccessPoint wizards for Scl element Services should look like snapshot"] = -` -
- - - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-`; -/* end snapshot Wizards for SCL element Services AccessPoint wizards for Scl element Services should look like snapshot */ - -snapshots["Wizards for SCL element Services define a Services wizards Wizard 5 should look like snapshot"] = -` -
- - - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Dyn - - - Conf - - - Fix - - - - - Conf - - - Fix - - - - - - - - - - - - - - - - - - - - - - - - - - - unicast - - - multicast - - - both - - - - - - - - - - - - - - - - -
- -
`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 5 should look like snapshot */ - -snapshots["Wizards for SCL element Services define a Services wizards Wizard 6 should look like snapshot"] = -` -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
-`; -/* end snapshot Wizards for SCL element Services define a Services wizards Wizard 6 should look like snapshot */ +/* end snapshot Wizards for SCL element Services AccessPoint wizards for Scl element Services should look like snapshot */ diff --git a/packages/open-scd/test/integration/wizards/services-wizard.test.ts b/packages/open-scd/test/integration/wizards/services-wizard.test.ts index f2ab7906e7..fa340f5841 100644 --- a/packages/open-scd/test/integration/wizards/services-wizard.test.ts +++ b/packages/open-scd/test/integration/wizards/services-wizard.test.ts @@ -4,6 +4,7 @@ import { editServicesWizard } from '../../../src/wizards/services.js'; import '../../mock-wizard-editor.js'; import { MockWizardEditor } from '../../mock-wizard-editor.js'; +import { WizardDialog } from '../../../src/wizard-dialog.js'; describe('Wizards for SCL element Services', () => { let doc: XMLDocument; @@ -45,6 +46,23 @@ describe('Wizards for SCL element Services', () => { expect(element.wizardUI.dialogs[idx]).to.equalSnapshot(); }); }); + + describe('> when pro mode is enabled', () => { + let elm: WizardDialog; + beforeEach(async () => { + elm = element.shadowRoot!.querySelector('wizard-dialog')!; + localStorage.setItem('mode', 'pro'); + elm.requestUpdate(); + await elm.updateComplete; + }); + [0, 1, 2, 3, 4, 5].forEach(idx => { + it(`Wizard ${idx + 1} should contain the code icon button`, () => { + expect(element.wizardUI.dialogs[idx].querySelector('mwc-icon-button-toggle')).to.have.attribute('onicon', 'code'); + }); + }); + }); + after(() => localStorage.removeItem('mode')); + }); ['AP2', 'AP3', 'AP4', 'AP5', 'AP6'].forEach(accessPointName => {