@@ -19,13 +19,13 @@ import {
19
19
WizardInputElement ,
20
20
} from '../../../src/foundation.js' ;
21
21
import {
22
+ contentGseControlWizard ,
23
+ createGseControlWizard ,
22
24
editGseControlWizard ,
25
+ gseControlParentSelector ,
23
26
removeGseControlAction ,
24
- contentGseControlWizard ,
25
27
selectGseControlWizard ,
26
28
updateGseControlAction ,
27
- gseControlParentSelector ,
28
- createGseControlWizard ,
29
29
} from '../../../src/wizards/gsecontrol.js' ;
30
30
import { regExp , regexString } from '../../foundation.js' ;
31
31
import { FinderList } from '../../../src/finder-list.js' ;
@@ -413,7 +413,7 @@ describe('gsecontrol wizards', () => {
413
413
414
414
const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
415
415
. actions ;
416
- expect ( actions . length ) . to . equal ( 3 ) ;
416
+ expect ( actions . length ) . to . equal ( 6 ) ;
417
417
const action = actions [ 0 ] ;
418
418
expect ( action ) . to . satisfy ( isCreate ) ;
419
419
const createAction = < Create > action ;
@@ -427,7 +427,7 @@ describe('gsecontrol wizards', () => {
427
427
428
428
const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
429
429
. actions ;
430
- expect ( actions . length ) . to . equal ( 3 ) ;
430
+ expect ( actions . length ) . to . equal ( 6 ) ;
431
431
const action = actions [ 0 ] ;
432
432
expect ( action ) . to . satisfy ( isCreate ) ;
433
433
const createAction = < Create > action ;
@@ -439,8 +439,8 @@ describe('gsecontrol wizards', () => {
439
439
440
440
const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
441
441
. actions ;
442
- expect ( actions . length ) . to . equal ( 3 ) ;
443
- const action = actions [ 2 ] ;
442
+ expect ( actions . length ) . to . equal ( 6 ) ;
443
+ const action = actions [ 5 ] ;
444
444
expect ( action ) . to . satisfy ( isCreate ) ;
445
445
const createAction = < Create > action ;
446
446
expect ( ( < Element > createAction . new . element ) . tagName ) . to . equal ( 'DataSet' ) ;
@@ -449,10 +449,17 @@ describe('gsecontrol wizards', () => {
449
449
it ( 'referenced DataSet element not having any FCDA per default' , async ( ) => {
450
450
await primaryAction . click ( ) ;
451
451
452
- const createAction = < Create > (
453
- ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action ) . actions [ 2 ]
454
- ) ;
455
- expect ( ( < Element > createAction . new . element ) . children ) . to . be . empty ;
452
+ const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
453
+ . actions ;
454
+ expect ( actions . length ) . to . equal ( 6 ) ;
455
+
456
+ actions . forEach ( action => {
457
+ expect ( action ) . to . satisfy ( isCreate ) ;
458
+ const createAction = < Create > action ;
459
+ expect ( ( < Element > createAction . new . element ) . tagName ) . to . not . equal (
460
+ 'FCDA'
461
+ ) ;
462
+ } ) ;
456
463
} ) ;
457
464
458
465
it ( 'referenced DataSet element saving selected FCDA' , async ( ) => {
@@ -469,21 +476,21 @@ describe('gsecontrol wizards', () => {
469
476
470
477
await primaryAction . click ( ) ;
471
478
472
- const createAction = < Create > (
473
- ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action ) . actions [ 2 ]
474
- ) ;
475
- expect ( ( < Element > createAction . new . element ) . children ) . to . not . be . empty ;
476
- expect ( ( < Element > createAction . new . element ) . children ) . to . have . lengthOf (
477
- 1
478
- ) ;
479
+ const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
480
+ . actions ;
481
+ expect ( actions . length ) . to . equal ( 7 ) ;
482
+ const action = actions [ 6 ] ;
483
+ expect ( action ) . to . satisfy ( isCreate ) ;
484
+ const createAction = < Create > action ;
485
+ expect ( ( < Element > createAction . new . element ) . tagName ) . to . equal ( 'FCDA' ) ;
479
486
} ) ;
480
487
481
488
it ( 'complex action adding GSE element in the Communication section' , async ( ) => {
482
489
await primaryAction . click ( ) ;
483
490
484
491
const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
485
492
. actions ;
486
- expect ( actions . length ) . to . equal ( 3 ) ;
493
+ expect ( actions . length ) . to . equal ( 6 ) ;
487
494
const action = actions [ 1 ] ;
488
495
expect ( action ) . to . satisfy ( isCreate ) ;
489
496
const createAction = < Create > action ;
@@ -533,6 +540,45 @@ describe('gsecontrol wizards', () => {
533
540
expect ( action ) . to . not . satisfy ( isSimple ) ;
534
541
} ) ;
535
542
543
+ it ( 'referenced DataSet element not having any FCDA per default' , async ( ) => {
544
+ await primaryAction . click ( ) ;
545
+
546
+ const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
547
+ . actions ;
548
+ expect ( actions . length ) . to . equal ( 2 ) ;
549
+
550
+ actions . forEach ( action => {
551
+ expect ( action ) . to . satisfy ( isCreate ) ;
552
+ const createAction = < Create > action ;
553
+ expect ( ( < Element > createAction . new . element ) . tagName ) . to . not . equal (
554
+ 'FCDA'
555
+ ) ;
556
+ } ) ;
557
+ } ) ;
558
+
559
+ it ( 'referenced DataSet element saving selected FCDA' , async ( ) => {
560
+ const path = [
561
+ 'Server: IED4>P1' ,
562
+ 'LDevice: IED4>>MU01' ,
563
+ 'LN0: IED4>>MU01' ,
564
+ 'DO: #Dummy.LLN0.two>Beh' ,
565
+ 'DA: #Dummy.LLN0.Beh>stVal' ,
566
+ ] ;
567
+
568
+ dataPicker . paths = [ path ] ;
569
+ await element . requestUpdate ( ) ;
570
+
571
+ await primaryAction . click ( ) ;
572
+
573
+ const actions = ( < ComplexAction > actionEvent . args [ 0 ] [ 0 ] . detail . action )
574
+ . actions ;
575
+ expect ( actions . length ) . to . equal ( 3 ) ;
576
+ const action = actions [ 2 ] ;
577
+ expect ( action ) . to . satisfy ( isCreate ) ;
578
+ const createAction = < Create > action ;
579
+ expect ( ( < Element > createAction . new . element ) . tagName ) . to . equal ( 'FCDA' ) ;
580
+ } ) ;
581
+
536
582
it ( 'complex action NOT adding GSE element in the Communication section' , async ( ) => {
537
583
await primaryAction . click ( ) ;
538
584
0 commit comments