@@ -63,53 +63,53 @@ describe('nsdoc', () => {
63
63
it ( 'returns the lnClass in case no title can be found' , async function ( ) {
64
64
const ln = validSCL . querySelector (
65
65
'IED[name="IED1"] > AccessPoint[name="P1"] > Server > LDevice[inst="CircuitBreaker_CB1"] > LN[lnClass="XCBR"]' ) ;
66
-
66
+
67
67
expect ( nsdocsObject . getDataDescription ( ln ! ) . label ) . to . eql ( 'XCBR' ) ;
68
68
} ) ;
69
69
} ) ;
70
70
71
71
describe ( 'which for DO elements' , ( ) => {
72
72
it ( 'returns the description' , async function ( ) {
73
73
const dataObject = validSCL . querySelector ( 'LNodeType[id="Dummy.LLN0"] > DO[name="Beh"]' ) ;
74
-
74
+
75
75
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'Some DO description' ) ;
76
76
} ) ;
77
-
77
+
78
78
it ( 'returns the description where the DO is part of a parent class' , async function ( ) {
79
79
const dataObject = validSCL . querySelector ( 'LNodeType[id="Dummy.XCBR1"] > DO[name="Beh"]' ) ;
80
-
80
+
81
81
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'Some DomainLN Description' ) ;
82
82
} ) ;
83
-
83
+
84
84
it ( 'returns the name in case no description can be found' , async function ( ) {
85
85
const dataObject = validSCL . querySelector ( 'LNodeType[id="Dummy.LLN0"] > DO[name="Health"]' ) ;
86
-
86
+
87
87
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'Health' ) ;
88
88
} ) ;
89
89
} ) ;
90
90
91
91
describe ( 'which for DA elements' , ( ) => {
92
92
it ( 'returns the description defined in IEC 61850-7-3' , async function ( ) {
93
93
const dataObject = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="q"]' ) ;
94
-
94
+
95
95
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'Some DA description' ) ;
96
96
} ) ;
97
-
97
+
98
98
it ( 'returns the name in case no description can be found in IEC 61850-7-3' , async function ( ) {
99
99
const dataObject = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="t"]' ) ;
100
-
100
+
101
101
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 't' ) ;
102
102
} ) ;
103
-
103
+
104
104
it ( 'returns the description defined in IEC 61850-8-1' , async function ( ) {
105
105
const dataObject = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="SBOw"]' ) ;
106
-
106
+
107
107
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'Some SBOw title' ) ;
108
108
} ) ;
109
-
109
+
110
110
it ( 'which returns the name in case no description can be found in IEC 61850-8-1' , async function ( ) {
111
111
const dataObject = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="SBO"]' ) ;
112
-
112
+
113
113
expect ( nsdocsObject . getDataDescription ( dataObject ! ) . label ) . to . eql ( 'SBO' ) ;
114
114
} ) ;
115
115
} ) ;
@@ -118,31 +118,39 @@ describe('nsdoc', () => {
118
118
it ( 'returns the description defined in IEC 61850-7-3' , async function ( ) {
119
119
const bdaElement = validSCL . querySelector ( 'DAType[id="AnalogueValue_i"] > BDA[name="i"]' ) ;
120
120
const bdaElementParent = validSCL . querySelector ( 'DOType[id="DummySAV"] > DA[name="instMag"]' ) ;
121
-
121
+
122
122
expect ( nsdocsObject . getDataDescription ( bdaElement ! , [ bdaElementParent ! ] ) . label ) . to . eql ( 'Some i description' ) ;
123
123
} ) ;
124
-
124
+
125
125
it ( 'returns the name in case no description can be found in IEC 61850-7-3' , async function ( ) {
126
126
const bdaElement = validSCL . querySelector ( 'DAType[id="AnalogueValue_i"] > BDA[name="x"]' ) ;
127
127
const bdaElementParent = validSCL . querySelector ( 'DOType[id="DummySAV"] > DA[name="instMag"]' ) ;
128
-
128
+
129
129
expect ( nsdocsObject . getDataDescription ( bdaElement ! , [ bdaElementParent ! ] ) . label ) . to . eql ( 'x' ) ;
130
130
} ) ;
131
-
131
+
132
132
it ( 'returns the description defined in IEC 61850-8-1' , async function ( ) {
133
133
const bdaElement = validSCL . querySelector ( 'DAType[id="Dummy.LLN0.Mod.SBOw"] > BDA[name="ctlNum"]' ) ;
134
134
const bdaElementParent = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="SBOw"]' ) ;
135
-
135
+
136
136
expect ( nsdocsObject . getDataDescription ( bdaElement ! , [ bdaElementParent ! ] ) . label ) . to . eql ( 'Some ctlNum description' ) ;
137
137
} ) ;
138
-
138
+
139
139
it ( 'returns the name in case no description can be found in IEC 61850-8-1' , async function ( ) {
140
140
const bdaElement = validSCL . querySelector ( 'DAType[id="Dummy.LLN0.Mod.SBOw"] > BDA[name="T"]' ) ;
141
141
const bdaElementParent = validSCL . querySelector ( 'DOType[id="Dummy.LLN0.Mod"] > DA[name="SBOw"]' ) ;
142
-
142
+
143
143
expect ( nsdocsObject . getDataDescription ( bdaElement ! , [ bdaElementParent ! ] ) . label ) . to . eql ( 'T' ) ;
144
144
} ) ;
145
145
} ) ;
146
146
} ) ;
147
147
} ) ;
148
- } ) ;
148
+ } ) ;
149
+
150
+ export function cleanLocalStorageForNsdocFiles ( ) {
151
+ // Cleanup NSDoc Files from LocalStorage
152
+ localStorage . removeItem ( 'IEC 61850-7-2' ) ;
153
+ localStorage . removeItem ( 'IEC 61850-7-3' ) ;
154
+ localStorage . removeItem ( 'IEC 61850-7-4' ) ;
155
+ localStorage . removeItem ( 'IEC 61850-8-1' ) ;
156
+ }
0 commit comments