Skip to content

Commit 31fd177

Browse files
authored
fix(editors/later-binding): Resolve absent prefix in ExtRef for later binding subscription (openscd#1026)
* Resolve absent prefix in ExtRef for later binding subscription, part of openscd#1005 * Correct approach from review feedback * Add tests * Update snapshots * Tidy up, update snapshots, update tests
1 parent 2bdb958 commit 31fd177

File tree

5 files changed

+444
-412
lines changed

5 files changed

+444
-412
lines changed

src/editors/subscription/later-binding/ext-ref-later-binding-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export class ExtRefLaterBindingList extends LitElement {
9494
attributeName: string
9595
): boolean {
9696
return (
97-
extRefElement.getAttribute(attributeName) ===
98-
this.currentSelectedFcdaElement?.getAttribute(attributeName)
97+
(extRefElement.getAttribute(attributeName) ?? '') ===
98+
(this.currentSelectedFcdaElement?.getAttribute(attributeName) ?? '')
9999
);
100100
}
101101

test/integration/editors/GooseSubscriberLaterBinding.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
4545
).to.be.equal(0);
4646
expect(
4747
extRefListElement['getAvailableExtRefElements']().length
48-
).to.be.equal(2);
48+
).to.be.equal(4);
4949

5050
(<HTMLElement>(
5151
extRefListElement.shadowRoot!.querySelector(
@@ -59,7 +59,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
5959
).to.be.equal(1);
6060
expect(
6161
extRefListElement['getAvailableExtRefElements']().length
62-
).to.be.equal(1);
62+
).to.be.equal(3);
6363
});
6464

6565
it('when unsubscribing a subscribed ExtRef then the lists are changed', async () => {
@@ -79,7 +79,7 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
7979
).to.be.equal(2);
8080
expect(
8181
extRefListElement['getAvailableExtRefElements']().length
82-
).to.be.equal(2);
82+
).to.be.equal(4);
8383
(<HTMLElement>(
8484
extRefListElement.shadowRoot!.querySelector(
8585
'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"]'
@@ -92,6 +92,6 @@ describe('GOOSE Subscribe Later Binding Plugin', () => {
9292
).to.be.equal(1);
9393
expect(
9494
extRefListElement['getAvailableExtRefElements']().length
95-
).to.be.equal(3);
95+
).to.be.equal(5);
9696
});
9797
});

0 commit comments

Comments
 (0)