Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editors/ied): Improve IED editor UI for IED and LN selection #1288

Merged
merged 13 commits into from
Sep 25, 2023
Merged
1 change: 1 addition & 0 deletions src/editors/IED.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default class IedPlugin extends LitElement {
multi="true"
.header="${translate('iededitor.lnFilter')}"
@selected-items-changed="${(e: SelectedItemsChangedEvent) => {
if (e.detail.selectedItems.length === 0) return;
danyill marked this conversation as resolved.
Show resolved Hide resolved
this.selectedLNClasses = e.detail.selectedItems;
this.requestUpdate('selectedIed');
this.lNClassListOpenedOnce = true;
Expand Down
31 changes: 31 additions & 0 deletions test/integration/editors/IED.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,37 @@ describe('IED Plugin', () => {
).to.eql(9);
});

it('when filtering LNs, if none are selected, all are selected', async () => {
await selectIed('IED3');

const oscdFilterButton = <FilterButton>(
element.shadowRoot!.querySelector(
'oscd-filter-button[id="lnClassesFilter"]'
)
);
const filterButton = <LitElement>(
oscdFilterButton!.shadowRoot!.querySelector('mwc-icon-button')
);
filterButton.click();
await element.updateComplete;

const primaryButton = <HTMLElement>(
oscdFilterButton!.shadowRoot!.querySelector(
'mwc-button[slot="primaryAction"]'
)
);
primaryButton.click();
await element.updateComplete;

await new Promise(resolve => setTimeout(resolve, 100)); // await animation

expect(
getLDeviceContainer(getIedContainer()).shadowRoot!.querySelectorAll(
'ln-container'
).length
).to.eql(9);
});

it('then renders the path of elements correctly', async () => {
const iedContainer = getIedContainer();

Expand Down