@@ -17,27 +17,24 @@ import {
1717} from "./insertSelectedDataType.testfiles.js" ;
1818
1919import { insertSelectedLNodeType } from "./insertSelectedLNodeType.js" ;
20+ import { LNodeDescription , nsdToJson } from "./nsdToJson.js" ;
2021
2122const incompleteMmxu = findElement ( missingMmxuTypes ) as XMLDocument ;
2223const imcompleteLtrk = findElement ( incompleteLtrkTypes ) as XMLDocument ;
2324const incompleteAtcc = findElement ( incompleteAtccTypes ) as XMLDocument ;
2425const missingDataTypes = findElement ( emptySSD ) as XMLDocument ;
2526
2627describe ( "insertLNodeTypeSelection" , ( ) => {
27- it ( "return empty array with invlaid lnClass" , ( ) => {
28- expect (
29- insertSelectedLNodeType ( incompleteMmxu , mmxuSelection , "ERRO" ) . length ,
30- ) . to . equal ( 0 ) ;
31- } ) ;
32-
33- it ( 'is insensitive for invalid EnumTypes' , ( ) =>
34- insertSelectedLNodeType ( incompleteMmxu , invalidSelection , "LLN0" ) )
28+ it ( 'is insensitive for invalid EnumTypes' , ( ) => {
29+ const data = nsdToJson ( "LLN0" ) as LNodeDescription ;
30+ insertSelectedLNodeType ( incompleteMmxu , invalidSelection , { class :"LLN0" , data} ) ;
31+ } )
3532
3633 it ( "insert MMXU LNodeType including missing sub data" , ( ) => {
3734 const edits = insertSelectedLNodeType (
3835 incompleteMmxu ,
3936 mmxuSelection ,
40- "MMXU" ,
37+ { class : "MMXU" } ,
4138 ) ;
4239
4340 expect ( edits . length ) . to . equal ( 6 ) ;
@@ -81,10 +78,11 @@ describe("insertLNodeTypeSelection", () => {
8178 } ) ;
8279
8380 it ( "insert LTRK LNodeType including missing sub data" , ( ) => {
81+ const data = nsdToJson ( "LTRK" ) as LNodeDescription ;
8482 const edits = insertSelectedLNodeType (
8583 imcompleteLtrk ,
8684 ltrkSelection ,
87- "LTRK" ,
85+ { class : "LTRK" , data } ,
8886 ) ;
8987
9088 expect ( edits . length ) . to . equal ( 7 ) ;
@@ -136,10 +134,11 @@ describe("insertLNodeTypeSelection", () => {
136134 } ) ;
137135
138136 it ( "insert ATCC LNodeType including missing sub data" , ( ) => {
137+ const data = nsdToJson ( "ATCC" ) as LNodeDescription ;
139138 const edits = insertSelectedLNodeType (
140139 incompleteAtcc ,
141140 atccSelection ,
142- "ATCC" ,
141+ { class : "ATCC" , data } ,
143142 ) ;
144143
145144 expect ( edits . length ) . to . equal ( 5 ) ;
@@ -178,10 +177,11 @@ describe("insertLNodeTypeSelection", () => {
178177 } ) ;
179178
180179 it ( "insert DataTypeTemplates when missing" , ( ) => {
180+ const data = nsdToJson ( "ATCC" ) as LNodeDescription ;
181181 const edits = insertSelectedLNodeType (
182182 missingDataTypes ,
183183 atccSelection ,
184- "ATCC" ,
184+ { class : "ATCC" , data } ,
185185 ) ;
186186
187187 expect ( edits . length ) . to . equal ( 19 ) ;
0 commit comments