Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clepski committed Jul 9, 2024
1 parent df54175 commit 80a42e1
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,44 @@ describe('FCDA specification', () => {
bType: 'INT32',
}));
});

describe('use default value for ExtRef without srcLNClass attribute', () => {
let doc: XMLDocument;
beforeEach(async () => {
doc = await fetch('/test/testfiles/editors/ExtRefWithoutSrcLNClass.scd')
.then(response => response.text())
.then(str => new DOMParser().parseFromString(str, 'application/xml'));
});

it('should correctly consider ExtRef with srcLNClass attribute as subscribed', () => {
const fcda = doc.querySelector(
'FCDA[ldInst="QB2_Disconnector"][doName="Pos"][daName="stVal"]'
)!;
const controlBlock = doc.querySelector(
'IED[name="Publisher"] GSEControl[name="GOOSE2"]'
)!;

const extRef = doc.querySelector(
'ExtRef[iedName="Publisher"][ldInst="QB2_Disconnector"][doName="Pos"][daName="stVal"][srcLNClass="LLN0"]'
)!;

const isSubscribed = isSubscribedTo('GSEControl', controlBlock, fcda, extRef);
expect(isSubscribed).to.be.true;
});

it('should correctly consider ExtRef without srcLNClass attribute as subscribed', () => {
const fcda = doc.querySelector(
'FCDA[ldInst="QB2_Disconnector"][doName="Pos"][daName="q"]'
)!;
const controlBlock = doc.querySelector(
'IED[name="Publisher"] GSEControl[name="GOOSE2"]'
)!;

const extRef = doc.querySelector(
'ExtRef[iedName="Publisher"][ldInst="QB2_Disconnector"][doName="Pos"][daName="q"]'
)!;

const isSubscribed = isSubscribedTo('GSEControl', controlBlock, fcda, extRef);
expect(isSubscribed).to.be.true;
});
});

0 comments on commit 80a42e1

Please sign in to comment.