Skip to content

Commit

Permalink
fix(editors/later-binding): Resolve absent prefix in ExtRef for later…
Browse files Browse the repository at this point in the history
… binding subscription (#1026)

* Resolve absent prefix in ExtRef for later binding subscription, part of #1005

* Correct approach from review feedback

* Add tests

* Update snapshots

* Tidy up, update snapshots, update tests
  • Loading branch information
danyill authored Oct 5, 2022
1 parent 2bdb958 commit 31fd177
Show file tree
Hide file tree
Showing 5 changed files with 444 additions and 412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export class ExtRefLaterBindingList extends LitElement {
attributeName: string
): boolean {
return (
extRefElement.getAttribute(attributeName) ===
this.currentSelectedFcdaElement?.getAttribute(attributeName)
(extRefElement.getAttribute(attributeName) ?? '') ===
(this.currentSelectedFcdaElement?.getAttribute(attributeName) ?? '')
);
}

Expand Down
8 changes: 4 additions & 4 deletions test/integration/editors/GooseSubscriberLaterBinding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
).to.be.equal(0);
expect(
extRefListElement['getAvailableExtRefElements']().length
).to.be.equal(2);
).to.be.equal(4);

(<HTMLElement>(
extRefListElement.shadowRoot!.querySelector(
Expand All @@ -59,7 +59,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
).to.be.equal(1);
expect(
extRefListElement['getAvailableExtRefElements']().length
).to.be.equal(1);
).to.be.equal(3);
});

it('when unsubscribing a subscribed ExtRef then the lists are changed', async () => {
Expand All @@ -79,7 +79,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
).to.be.equal(2);
expect(
extRefListElement['getAvailableExtRefElements']().length
).to.be.equal(2);
).to.be.equal(4);
(<HTMLElement>(
extRefListElement.shadowRoot!.querySelector(
'mwc-list-item[value="GOOSE_Subscriber>>Earth_Switch> CSWI 1>GOOSE:GOOSE2 QB2_Disconnector/ LLN0 GOOSE_Publisher QB2_Disconnector/ CSWI 1 Pos q@Pos;CSWI1/Pos/q"]'
Expand All @@ -92,6 +92,6 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
).to.be.equal(1);
expect(
extRefListElement['getAvailableExtRefElements']().length
).to.be.equal(3);
).to.be.equal(5);
});
});
Loading

0 comments on commit 31fd177

Please sign in to comment.