@@ -48,11 +48,14 @@ describe('Export IED Params Plugin -', () => {
48
48
} ) ;
49
49
} ) ;
50
50
51
- describe ( 'retrieve the data template element from a type element (getDataElement ) -' , ( ) => {
51
+ describe ( 'retrieve the data template element from a type element (getDataTypeChildElement ) -' , ( ) => {
52
52
it ( 'when called with a LNodeType element and a known name is passed then correct DO Element returned' , ( ) => {
53
53
const typeElement = doc . querySelector ( 'LNodeType[id="Dummy.TVTR"]' ) ;
54
54
55
- const dataElement = plugin [ 'getDataElement' ] ( typeElement ! , 'Beh' ) ;
55
+ const dataElement = plugin [ 'getDataTypeChildElement' ] (
56
+ typeElement ! ,
57
+ 'Beh'
58
+ ) ;
56
59
expect ( dataElement ) . to . be . not . null ;
57
60
expect ( dataElement ?. tagName ) . to . be . equal ( 'DO' ) ;
58
61
expect ( dataElement ) . to . have . attribute ( 'type' , 'OpenSCD_ENS_Beh' ) ;
@@ -61,14 +64,17 @@ describe('Export IED Params Plugin -', () => {
61
64
it ( 'when called with a LNodeType element and a unknown name is passed then null returned' , ( ) => {
62
65
const typeElement = doc . querySelector ( 'LNodeType[id="Dummy.TVTR"]' ) ;
63
66
64
- const dataElement = plugin [ 'getDataElement' ] ( typeElement ! , 'Unknown' ) ;
67
+ const dataElement = plugin [ 'getDataTypeChildElement' ] (
68
+ typeElement ! ,
69
+ 'Unknown'
70
+ ) ;
65
71
expect ( dataElement ) . to . be . null ;
66
72
} ) ;
67
73
68
74
it ( 'when called with a DOType element and a known name is passed then correct DO Element returned' , ( ) => {
69
75
const typeElement = doc . querySelector ( 'DOType[id="Dummy.ASG"]' ) ;
70
76
71
- const dataElement = plugin [ 'getDataElement ' ] ( typeElement ! , 'q' ) ;
77
+ const dataElement = plugin [ 'getDataTypeChildElement ' ] ( typeElement ! , 'q' ) ;
72
78
expect ( dataElement ) . to . be . not . null ;
73
79
expect ( dataElement ?. tagName ) . to . be . equal ( 'DA' ) ;
74
80
expect ( dataElement ) . to . have . attribute ( 'bType' , 'Quality' ) ;
@@ -77,16 +83,22 @@ describe('Export IED Params Plugin -', () => {
77
83
it ( 'when called with a DOType element and a unknown name is passed then null returned' , ( ) => {
78
84
const typeElement = doc . querySelector ( 'DOType[id="Dummy.ASG"]' ) ;
79
85
80
- const dataElement = plugin [ 'getDataElement' ] ( typeElement ! , 'Unknown' ) ;
86
+ const dataElement = plugin [ 'getDataTypeChildElement' ] (
87
+ typeElement ! ,
88
+ 'Unknown'
89
+ ) ;
81
90
expect ( dataElement ) . to . be . null ;
82
91
} ) ;
83
92
84
- it ( 'when called with a DAType element and a known name is passed then correct DO Element returned' , ( ) => {
93
+ it ( 'when called with a DAType element and a known name is passed then correct BDA Element returned' , ( ) => {
85
94
const typeElement = doc . querySelector (
86
95
'DAType[id="OpenSCD_Cancel_BehaviourModeKind"]'
87
96
) ;
88
97
89
- const dataElement = plugin [ 'getDataElement' ] ( typeElement ! , 'ctlNum' ) ;
98
+ const dataElement = plugin [ 'getDataTypeChildElement' ] (
99
+ typeElement ! ,
100
+ 'ctlNum'
101
+ ) ;
90
102
expect ( dataElement ) . to . be . not . null ;
91
103
expect ( dataElement ?. tagName ) . to . be . equal ( 'BDA' ) ;
92
104
expect ( dataElement ) . to . have . attribute ( 'bType' , 'INT8U' ) ;
@@ -97,29 +109,32 @@ describe('Export IED Params Plugin -', () => {
97
109
'DAType[id="OpenSCD_Cancel_BehaviourModeKind"]'
98
110
) ;
99
111
100
- const dataElement = plugin [ 'getDataElement' ] ( typeElement ! , 'Unknown' ) ;
112
+ const dataElement = plugin [ 'getDataTypeChildElement' ] (
113
+ typeElement ! ,
114
+ 'Unknown'
115
+ ) ;
101
116
expect ( dataElement ) . to . be . null ;
102
117
} ) ;
103
118
} ) ;
104
119
105
- describe ( 'retrieve the type element from a data element (getTypeElement ) -' , ( ) => {
120
+ describe ( 'retrieve the type element from a data element (getDataTypeTemplateElement ) -' , ( ) => {
106
121
it ( 'when passing a DO Element then the DOType Element is returned' , ( ) => {
107
122
const doElement = doc . querySelector (
108
123
'LNodeType[id="Dummy.TCTR"] > DO[name="Rat"]'
109
124
) ;
110
125
111
- const typeElement = plugin [ 'getTypeElement ' ] ( doElement ) ;
126
+ const typeElement = plugin [ 'getDataTypeTemplateElement ' ] ( doElement ) ;
112
127
expect ( typeElement ) . to . be . not . null ;
113
128
expect ( typeElement ?. tagName ) . to . be . equal ( 'DOType' ) ;
114
129
expect ( typeElement ) . to . have . attribute ( 'cdc' , 'ASG' ) ;
115
130
} ) ;
116
131
117
- it ( 'when passing a DA Element then the DOType Element is returned' , ( ) => {
132
+ it ( 'when passing a DA Element then the DAType Element is returned' , ( ) => {
118
133
const daElement = doc . querySelector (
119
134
'DOType[id="OpenSCD_ENC_Mod"] > DA[name="Oper"]'
120
135
) ;
121
136
122
- const typeElement = plugin [ 'getTypeElement ' ] ( daElement ) ;
137
+ const typeElement = plugin [ 'getDataTypeTemplateElement ' ] ( daElement ) ;
123
138
expect ( typeElement ) . to . be . not . null ;
124
139
expect ( typeElement ?. tagName ) . to . be . equal ( 'DAType' ) ;
125
140
expect ( typeElement ) . to . have . attribute (
@@ -193,7 +208,7 @@ describe('Export IED Params Plugin -', () => {
193
208
it ( 'when something else as a LN element is passed then null is returned' , ( ) => {
194
209
const value = plugin [ 'getDataAttributeTemplateValue' ] ( iedElement , [
195
210
'ARtgSec' ,
196
- 'stVal ' ,
211
+ 'setVal ' ,
197
212
] ) ;
198
213
199
214
expect ( value ) . to . be . null ;
@@ -214,7 +229,7 @@ describe('Export IED Params Plugin -', () => {
214
229
it ( 'when a instance value is defined then that value is returned' , ( ) => {
215
230
const value = plugin [ 'getDataAttributeInstanceValue' ] ( lnElement , [
216
231
'ARtgSec' ,
217
- 'stVal ' ,
232
+ 'setVal ' ,
218
233
] ) ;
219
234
220
235
expect ( value ) . to . be . equal ( '5' ) ;
@@ -238,7 +253,7 @@ describe('Export IED Params Plugin -', () => {
238
253
it ( 'when something else as a LN element is passed then null is returned' , ( ) => {
239
254
const value = plugin [ 'getDataAttributeInstanceValue' ] ( iedElement , [
240
255
'ARtgSec' ,
241
- 'stVal ' ,
256
+ 'setVal ' ,
242
257
] ) ;
243
258
244
259
expect ( value ) . to . be . null ;
@@ -257,7 +272,7 @@ describe('Export IED Params Plugin -', () => {
257
272
it ( 'when a instance value is defined then that value is returned' , ( ) => {
258
273
const value = plugin [ 'getDataAttributeValue' ] ( lnElement , [
259
274
'ARtgSec' ,
260
- 'stVal ' ,
275
+ 'setVal ' ,
261
276
] ) ;
262
277
263
278
expect ( value ) . to . be . equal ( '5' ) ;
0 commit comments