@@ -659,69 +659,69 @@ test(
659659 expect (
660660 testQuery . checkIfElementIsOptional ( attributes , 'LockType' )
661661 ) . toBeFalsy ( )
662- // mandatory conformance, optional="true" -> mandatory as conformance takes precedence
663- expect (
664- testQuery . checkIfElementIsOptional ( attributes , 'LockState' )
665- ) . toBeFalsy ( )
666- // mandatoryConform to feature DPS, optional="false" -> optional as conformance takes precedence
667- expect (
668- testQuery . checkIfElementIsOptional ( attributes , 'DoorState' )
669- ) . toBeTruthy ( )
670- // optionalConform to feature DPS, optional="true" -> optional
662+ // optionalConform to feature DPS, optional attribute undefined -> optional
671663 expect (
672664 testQuery . checkIfElementIsOptional ( attributes , 'DoorOpenEvents' )
673665 ) . toBeTruthy ( )
674- // optional conformance, optional="false" -> optional as conformance takes precedence
666+ // optional conformance, optional attribute undefined -> optional
675667 expect (
676668 testQuery . checkIfElementIsOptional ( attributes , 'Language' )
677669 ) . toBeTruthy ( )
670+ // mandatory conformance, optional="true" -> optional as optional="true" takes precedence
671+ expect (
672+ testQuery . checkIfElementIsOptional ( attributes , 'LockState' )
673+ ) . toBeTruthy ( )
674+ // mandatoryConform to feature DPS, optional="false" -> mandatory as optional="false" takes precedence
675+ expect (
676+ testQuery . checkIfElementIsOptional ( attributes , 'DoorState' )
677+ ) . toBeFalsy ( )
678678
679679 let commands = await queryCommand . selectCommandsByClusterId (
680680 db ,
681681 doorLockClusterId ,
682682 [ packageId ]
683683 )
684- // optional="true", conformance undefined -> optional
685- expect (
686- testQuery . checkIfElementIsOptional ( commands , 'GetWeekDaySchedule' )
687- ) . toBeTruthy ( )
688684 // optional attribute undefined, conformance undefined -> mandatory
689685 expect (
690686 testQuery . checkIfElementIsOptional ( commands , 'LockDoor' )
691687 ) . toBeFalsy ( )
692- // mandatory conformance, optional="true" -> mandatory as conformance takes precedence
688+ // optional="true", conformance undefined -> optional
693689 expect (
694- testQuery . checkIfElementIsOptional ( commands , 'UnlockDoor' )
695- ) . toBeFalsy ( )
690+ testQuery . checkIfElementIsOptional ( commands , 'GetWeekDaySchedule' )
691+ ) . toBeTruthy ( )
692+ // optional conformance, optional attribute undefined -> optional
693+ expect (
694+ testQuery . checkIfElementIsOptional ( commands , 'UnlockWithTimeout' )
695+ ) . toBeTruthy ( )
696696 // mandatoryConform to feature WDSCH, optional="true" -> optional
697697 expect (
698698 testQuery . checkIfElementIsOptional ( commands , 'SetWeekDaySchedule' )
699699 ) . toBeTruthy ( )
700- // optional conformance, optional="false " -> optional as conformance takes precedence
700+ // mandatory conformance, optional="true " -> optional as optional="true" takes precedence
701701 expect (
702- testQuery . checkIfElementIsOptional ( commands , 'UnlockWithTimeout ' )
702+ testQuery . checkIfElementIsOptional ( commands , 'UnlockDoor ' )
703703 ) . toBeTruthy ( )
704704
705705 let events = await queryEvent . selectEventsByClusterId (
706706 db ,
707707 doorLockClusterId
708708 )
709- // optional="true", conformance undefined -> optional
710- expect (
711- testQuery . checkIfElementIsOptional ( events , 'LockOperation' )
712- ) . toBeTruthy ( )
713709 // optional attribute undefined, conformance undefined -> mandatory
714710 expect (
715711 testQuery . checkIfElementIsOptional ( events , 'LockUserChange' )
716712 ) . toBeFalsy ( )
717- // mandatory conformance, optional="true" -> mandatory as conformance takes precedence
713+ // optional="true", conformance undefined -> optional
718714 expect (
719- testQuery . checkIfElementIsOptional ( events , 'DoorLockAlarm ' )
720- ) . toBeFalsy ( )
721- // mandatoryConform to feature DPS, optional="false" -> optional as conformance takes precedence
715+ testQuery . checkIfElementIsOptional ( events , 'LockOperation ' )
716+ ) . toBeTruthy ( )
717+ // mandatoryConform to feature DPS, optional attribute undefined -> optional
722718 expect (
723719 testQuery . checkIfElementIsOptional ( events , 'DoorStateChange' )
724720 ) . toBeTruthy ( )
721+ // mandatory conformance, optional="true" -> optional as optional="true" takes precedence
722+ expect (
723+ testQuery . checkIfElementIsOptional ( events , 'DoorLockAlarm' )
724+ ) . toBeTruthy ( )
725725 } finally {
726726 await dbApi . closeDatabase ( db )
727727 }
0 commit comments