Skip to content

Commit 243e043

Browse files
author
Dennis Labordus
committed
Changed tests.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent c7418c9 commit 243e043

File tree

8 files changed

+59
-61
lines changed

8 files changed

+59
-61
lines changed

test/unit/editors/protocol104/doi-container.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ describe('doi-104-container -', () => {
3131

3232
it('getDaiElements will return a list which is ordered on full path', () => {
3333
const dais = element.daiElements;
34-
expect(dais.length).to.be.equals(2);
35-
expect(getFullPath(dais[0], 'DOI')).to.be.equals('Oper / ctlVal');
36-
expect(getFullPath(dais[1], 'DOI')).to.be.equals('stVal');
34+
expect(dais.length).to.be.equal(2);
35+
expect(getFullPath(dais[0], 'DOI')).to.be.equal('Oper / ctlVal');
36+
expect(getFullPath(dais[1], 'DOI')).to.be.equal('stVal');
3737
});
3838

3939
it('getAddressElements will return a list', () => {
4040
const dai = element.daiElements[0];
4141
const addresses = element['getAddressElements'](dai);
42-
expect(addresses.length).to.be.equals(1);
43-
expect(get104DetailsLine(dai, addresses[0])).to.be.equals(
42+
expect(addresses.length).to.be.equal(1);
43+
expect(get104DetailsLine(dai, addresses[0])).to.be.equal(
4444
'casdu: 201, ioa: 2, ti: 58'
4545
);
4646
});

test/unit/editors/protocol104/foundation/actions.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('foundation', () => {
6161
'SPG',
6262
'58'
6363
);
64-
expect(actions.length).to.be.equals(1);
64+
expect(actions.length).to.be.equal(1);
6565
expect(actionEvent).to.have.been.calledOnce;
6666
});
6767

@@ -71,7 +71,7 @@ describe('foundation', () => {
7171
'ENG',
7272
'58'
7373
);
74-
expect(actions.length).to.be.equals(1);
74+
expect(actions.length).to.be.equal(1);
7575
expect(actionEvent).to.have.been.callCount(8);
7676
});
7777
});
@@ -112,7 +112,7 @@ describe('foundation', () => {
112112
'DPC',
113113
'59'
114114
);
115-
expect(actions.length).to.be.equals(1);
115+
expect(actions.length).to.be.equal(1);
116116
expect(actionEvent).to.have.been.calledTwice;
117117
});
118118
});

test/unit/editors/protocol104/foundation/cdc.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ describe('createAddressElements', () => {
1616
undefined
1717
);
1818

19-
expect(addressElements.length).to.be.equals(1);
20-
expect(addressElements[0].tagName).to.be.equals('Address');
21-
expect(addressElements[0].getAttribute('ti')).to.be.equals(ti);
19+
expect(addressElements.length).to.be.equal(1);
20+
expect(addressElements[0].tagName).to.be.equal('Address');
21+
expect(addressElements[0].getAttribute('ti')).to.be.equal(ti);
2222
});
2323

2424
it('only two address element created without expected value', async () => {
@@ -31,12 +31,12 @@ describe('createAddressElements', () => {
3131
undefined
3232
);
3333

34-
expect(addressElements.length).to.be.equals(2);
35-
expect(addressElements[0].tagName).to.be.equals('Address');
36-
expect(addressElements[0].getAttribute('ti')).to.be.equals(ti);
37-
expect(addressElements[1].tagName).to.be.equals('Address');
38-
expect(addressElements[1].getAttribute('ti')).to.be.equals(ti);
39-
expect(addressElements[1].getAttribute('inverted')).to.be.equals('true');
34+
expect(addressElements.length).to.be.equal(2);
35+
expect(addressElements[0].tagName).to.be.equal('Address');
36+
expect(addressElements[0].getAttribute('ti')).to.be.equal(ti);
37+
expect(addressElements[1].tagName).to.be.equal('Address');
38+
expect(addressElements[1].getAttribute('ti')).to.be.equal(ti);
39+
expect(addressElements[1].getAttribute('inverted')).to.be.equal('true');
4040
});
4141

4242
it('only single address element created with expected value', async () => {
@@ -50,10 +50,10 @@ describe('createAddressElements', () => {
5050
expectedValue
5151
);
5252

53-
expect(addressElements.length).to.be.equals(1);
54-
expect(addressElements[0].tagName).to.be.equals('Address');
55-
expect(addressElements[0].getAttribute('ti')).to.be.equals(ti);
56-
expect(addressElements[0].getAttribute('expectedValue')).to.be.equals(
53+
expect(addressElements.length).to.be.equal(1);
54+
expect(addressElements[0].tagName).to.be.equal('Address');
55+
expect(addressElements[0].getAttribute('ti')).to.be.equal(ti);
56+
expect(addressElements[0].getAttribute('expectedValue')).to.be.equal(
5757
expectedValue
5858
);
5959
});
@@ -69,16 +69,16 @@ describe('createAddressElements', () => {
6969
expectedValue
7070
);
7171

72-
expect(addressElements.length).to.be.equals(2);
73-
expect(addressElements[0].tagName).to.be.equals('Address');
74-
expect(addressElements[0].getAttribute('ti')).to.be.equals(ti);
75-
expect(addressElements[0].getAttribute('expectedValue')).to.be.equals(
72+
expect(addressElements.length).to.be.equal(2);
73+
expect(addressElements[0].tagName).to.be.equal('Address');
74+
expect(addressElements[0].getAttribute('ti')).to.be.equal(ti);
75+
expect(addressElements[0].getAttribute('expectedValue')).to.be.equal(
7676
expectedValue
7777
);
78-
expect(addressElements[1].tagName).to.be.equals('Address');
79-
expect(addressElements[1].getAttribute('ti')).to.be.equals(ti);
80-
expect(addressElements[1].getAttribute('inverted')).to.be.equals('true');
81-
expect(addressElements[1].getAttribute('expectedValue')).to.be.equals(
78+
expect(addressElements[1].tagName).to.be.equal('Address');
79+
expect(addressElements[1].getAttribute('ti')).to.be.equal(ti);
80+
expect(addressElements[1].getAttribute('inverted')).to.be.equal('true');
81+
expect(addressElements[1].getAttribute('expectedValue')).to.be.equal(
8282
expectedValue
8383
);
8484
});

test/unit/editors/protocol104/foundation/foundation.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('foundation', () => {
3333
const addressElement = daiElement!.querySelector(
3434
FIRST_PRIV_ADDRESS_QUERY
3535
);
36-
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equals(
36+
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equal(
3737
'casdu: 100, ioa: 4, ti: 62'
3838
);
3939
});
@@ -45,7 +45,7 @@ describe('foundation', () => {
4545
const addressElement = daiElement!.querySelector(
4646
FIRST_PRIV_ADDRESS_QUERY
4747
);
48-
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equals(
48+
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equal(
4949
'casdu: 101, ioa: 1, ti: 30, expectedValue: 1 (Ok)'
5050
);
5151
});
@@ -57,7 +57,7 @@ describe('foundation', () => {
5757
const addressElement = daiElement!.querySelector(
5858
FIRST_PRIV_ADDRESS_QUERY
5959
);
60-
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equals(
60+
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equal(
6161
'casdu: 202, ioa: 3, ti: 58, check: interlocking'
6262
);
6363
});
@@ -69,7 +69,7 @@ describe('foundation', () => {
6969
const addressElement = daiElement!.querySelector(
7070
FIRST_PRIV_ADDRESS_QUERY
7171
);
72-
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equals(
72+
expect(get104DetailsLine(daiElement!, addressElement!)).to.be.equal(
7373
'casdu: 1, ioa: 2, ti: 30, inverted: true'
7474
);
7575
});
@@ -80,7 +80,7 @@ describe('foundation', () => {
8080
const doiElement = document.querySelector(
8181
'IED[name="B2"] LN0[lnType="SE_LLN0_SET_default_V001"] DOI[name="Beh"]'
8282
);
83-
expect(getFullPath(doiElement!, 'IED')).to.be.equals(
83+
expect(getFullPath(doiElement!, 'IED')).to.be.equal(
8484
'AP1 / LD0 / LLN0 / Beh'
8585
);
8686
});
@@ -89,7 +89,7 @@ describe('foundation', () => {
8989
const daiElement = document.querySelector(
9090
'IED[name="B1"] LN0[lnType="SE_LLN0_SET_V001"] DAI[name="ctlVal"]'
9191
);
92-
expect(getFullPath(daiElement!, 'DOI')).to.be.equals('Oper / ctlVal');
92+
expect(getFullPath(daiElement!, 'DOI')).to.be.equal('Oper / ctlVal');
9393
});
9494
});
9595

@@ -99,15 +99,15 @@ describe('foundation', () => {
9999
const doiElement = document.querySelector(
100100
'IED[name="B2"] LN0[lnType="SE_LLN0_SET_default_V001"] DOI[name="Beh"]'
101101
);
102-
expect(getCdcValue(doiElement!)).to.be.equals('ENS');
102+
expect(getCdcValue(doiElement!)).to.be.equal('ENS');
103103
});
104104

105105
it('returns expected value for CDC "ENC"', () => {
106106
// Basic test to see if CDC is retrieved correctly.
107107
const doiElement = document.querySelector(
108108
'IED[name="B1"] LN0[lnType="SE_LLN0_SET_V001"] DOI[name="Mod"]'
109109
);
110-
expect(getCdcValue(doiElement!)).to.be.equals('ENC');
110+
expect(getCdcValue(doiElement!)).to.be.equal('ENC');
111111
});
112112
});
113113

test/unit/editors/protocol104/foundation/private.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('foundation', () => {
2525
const sclElement = document.querySelector('SCL')!;
2626
expect(
2727
sclElement.getAttribute('xmlns:' + PROTOCOL_104_PREFIX)
28-
).to.be.equals(PROTOCOL_104_NS);
28+
).to.be.equal(PROTOCOL_104_NS);
2929
});
3030

3131
it('do nothing when prefix exists', async () => {
@@ -36,23 +36,23 @@ describe('foundation', () => {
3636
let sclElement = document.querySelector('SCL')!;
3737
expect(
3838
sclElement.getAttribute('xmlns:' + PROTOCOL_104_PREFIX)
39-
).to.be.equals(PROTOCOL_104_NS);
39+
).to.be.equal(PROTOCOL_104_NS);
4040

4141
addPrefixAndNamespaceToDocument(document);
4242

4343
sclElement = document.querySelector('SCL')!;
4444
expect(
4545
sclElement.getAttribute('xmlns:' + PROTOCOL_104_PREFIX)
46-
).to.be.equals(PROTOCOL_104_NS);
46+
).to.be.equal(PROTOCOL_104_NS);
4747
});
4848
});
4949

5050
describe('createPrivateElement', () => {
5151
it('new private element is created with correct type', async () => {
5252
const privateElement = createPrivateElement(document);
5353

54-
expect(privateElement.tagName).to.be.equals('Private');
55-
expect(privateElement.getAttribute('type')).to.be.equals(
54+
expect(privateElement.tagName).to.be.equal('Private');
55+
expect(privateElement.getAttribute('type')).to.be.equal(
5656
PROTOCOL_104_PRIVATE
5757
);
5858
});
@@ -64,9 +64,9 @@ describe('foundation', () => {
6464

6565
const addressElement = createPrivateAddress(document, ti);
6666

67-
expect(addressElement.tagName).to.be.equals('Address');
68-
expect(addressElement.namespaceURI).to.be.equals(PROTOCOL_104_NS);
69-
expect(addressElement.getAttribute('ti')).to.be.equals(ti);
67+
expect(addressElement.tagName).to.be.equal('Address');
68+
expect(addressElement.namespaceURI).to.be.equal(PROTOCOL_104_NS);
69+
expect(addressElement.getAttribute('ti')).to.be.equal(ti);
7070
});
7171
});
7272
});

test/unit/editors/protocol104/ied-container.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ describe('ied-104-container -', () => {
2828

2929
it('getDoiElements will return a list which is alphabetically ordered', () => {
3030
const dois = element.doiElements;
31-
expect(dois.length).to.be.equals(2);
32-
expect(getFullPath(dois[0], 'IED')).to.be.equals(
33-
'AP1 / LD0 / LLN0 / Beh'
34-
);
35-
expect(getFullPath(dois[1], 'IED')).to.be.equals(
31+
expect(dois.length).to.be.equal(2);
32+
expect(getFullPath(dois[0], 'IED')).to.be.equal('AP1 / LD0 / LLN0 / Beh');
33+
expect(getFullPath(dois[1], 'IED')).to.be.equal(
3634
'AP1 / LD0 / PPRE-GGIO-2 / Beh'
3735
);
3836
});

test/unit/editors/protocol104/network-container.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { html, fixture, expect } from '@open-wc/testing';
1+
import { expect, fixture, html } from '@open-wc/testing';
22
import { SinonSpy, spy } from 'sinon';
33

4-
import '../../../../src/editors/protocol104/network-container.js'
4+
import '../../../../src/editors/protocol104/network-container.js';
55
import { Network104Container } from '../../../../src/editors/protocol104/network-container.js';
66

77
describe('network-104-container', () => {
@@ -15,7 +15,7 @@ describe('network-104-container', () => {
1515
.then(str => new DOMParser().parseFromString(str, 'application/xml'));
1616

1717
element = await fixture(
18-
html `<network-104-container .doc=${document}></network-104-container>`
18+
html`<network-104-container .doc=${document}></network-104-container>`
1919
);
2020

2121
wizardEvent = spy();
@@ -28,13 +28,13 @@ describe('network-104-container', () => {
2828

2929
it('getSubNetworkElements will return a list of SubNetwork elements which is alphabetically ordered', () => {
3030
const subNetworks = element['getSubNetworkElements']();
31-
expect(subNetworks.length).to.be.equals(2);
32-
expect(subNetworks[0].getAttribute('name')).to.be.equals('F1');
33-
expect(subNetworks[1].getAttribute('name')).to.be.equals('W1');
31+
expect(subNetworks.length).to.be.equal(2);
32+
expect(subNetworks[0].getAttribute('name')).to.be.equal('F1');
33+
expect(subNetworks[1].getAttribute('name')).to.be.equal('W1');
3434
});
35-
35+
3636
it('has a mwc-fab which calls a create SubNetwork wizard dialog', () => {
37-
(<HTMLElement>(element.shadowRoot?.querySelector('mwc-fab'))).click();
37+
(<HTMLElement>element.shadowRoot?.querySelector('mwc-fab')).click();
3838
expect(wizardEvent).to.have.be.calledOnce;
3939
expect(wizardEvent.args[0][0].detail.wizard()[0].title).to.contain('add');
4040
});

test/unit/editors/protocol104/values-container.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe('values-104-container', () => {
2424

2525
it('getIEDElements will return a list which is alphabetically ordered', () => {
2626
const ieds = element.iedElements;
27-
expect(ieds.length).to.be.equals(2);
28-
expect(ieds[0].getAttribute('name')).to.be.equals('B1');
29-
expect(ieds[1].getAttribute('name')).to.be.equals('B2');
27+
expect(ieds.length).to.be.equal(2);
28+
expect(ieds[0].getAttribute('name')).to.be.equal('B1');
29+
expect(ieds[1].getAttribute('name')).to.be.equal('B2');
3030
});
3131
});
3232

0 commit comments

Comments
 (0)