@@ -185,6 +199,19 @@ snapshots["Wizards for SCL ReportControl element define an edit wizard that for
delete
+
+
+ [controlblock.label.copy]
+
+
+ copy
+
+
@@ -353,6 +380,20 @@ snapshots["Wizards for SCL ReportControl element define a select wizard that wit
IED3>>CBSW> XSWI 1>ReportCb2
+
+
+ ReportCb
+
+
+ IED6>>CBSW>ReportCb
+
+
+
+
+
+
+ IED2
+
+
+ [controlblock.hints.source]
+
+
+
+
+ IED3
+
+
+ [controlblock.hints.exist]
+
+
+
+
+ IED4
+
+
+ [controlblock.hints.noMatchingData]
+
+
+
+
+ IED5
+
+
+ [controlBlock.hints.valid]
+
+
+
+
+ IED6
+
+
+ [controlblock.hints.exist]
+
+
+
+
+ IED7
+
+
+ [controlblock.hints.exist]
+
+
+
+
+
+
+
+
+
+`;
+/* end snapshot Wizards for SCL ReportControl element define copy to other IED selector looks like the latest snapshot */
+
diff --git a/test/unit/wizards/reportcontrol.test.ts b/test/unit/wizards/reportcontrol.test.ts
index 7ed64c733e..f3303de239 100644
--- a/test/unit/wizards/reportcontrol.test.ts
+++ b/test/unit/wizards/reportcontrol.test.ts
@@ -22,9 +22,12 @@ import {
editReportControlWizard,
removeReportControlAction,
selectReportControlWizard,
+ reportControlCopyToIedSelector,
} from '../../../src/wizards/reportcontrol.js';
import { inverseRegExp, regExp, regexString } from '../../foundation.js';
import { FinderList } from '../../../src/finder-list.js';
+import { FilteredList } from '../../../src/filtered-list.js';
+import { ListItemBase } from '@material/mwc-list/mwc-list-item-base';
describe('Wizards for SCL ReportControl element', () => {
let doc: XMLDocument;
@@ -687,4 +690,51 @@ describe('Wizards for SCL ReportControl element', () => {
await expect(element.wizardUI.dialog).dom.to.equalSnapshot();
}).timeout(5000);
});
+
+ describe('define copy to other IED selector', () => {
+ let iedsPicker: FilteredList;
+ let listItem: ListItemBase;
+
+ beforeEach(async () => {
+ const sourceReportControl = doc.querySelector(
+ 'IED[name="IED2"] ReportControl[name="ReportCb"]'
+ )!;
+ const wizard = reportControlCopyToIedSelector(sourceReportControl);
+ element.workflow.push(() => wizard);
+ await element.requestUpdate();
+
+ iedsPicker = (
+ element.wizardUI.dialog?.querySelector('filtered-list')
+ );
+
+ primaryAction = (
+ element.wizardUI.dialog?.querySelector(
+ 'mwc-button[slot="primaryAction"]'
+ )
+ );
+ });
+
+ it('looks like the latest snapshot', async () => {
+ await expect(element.wizardUI.dialog).dom.to.equalSnapshot();
+ }).timeout(5000);
+
+ it('allows to copy to multiple IED at once', () =>
+ expect(iedsPicker.multi).to.be.true);
+
+ describe('with a sink IED not meeting partially the data references', () => {
+ beforeEach(async () => {
+ listItem = iedsPicker.items.find(item => item.value.includes('IED5'))!;
+ await element.requestUpdate();
+ });
+
+ it('disabled the list item', () =>
+ expect(listItem.disabled).to.not.be.true);
+
+ it('does copy the control block ', () => {
+ listItem.click();
+ primaryAction.click();
+ expect(actionEvent).to.have.been.called;
+ });
+ });
+ });
});