File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 665665 {id}
666666 {name}
667667 >
668- {#if invalid}
669- < WarningFilled class = " bx--list-box__invalid-icon" / >
670- {/ if }
671- {#if ! invalid && warn}
672- < WarningAltFilled
673- class = " bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"
674- / >
675- {/ if }
676668 {#if value}
677669 < ListBoxSelection
678670 on: clear= {() => {
Original file line number Diff line number Diff line change @@ -678,6 +678,36 @@ describe("MultiSelect", () => {
678678 expect ( wrapper ) . toHaveClass ( "bx--multi-select--invalid" ) ;
679679 } ) ;
680680
681+ // Regression: filterable + invalid rendered two WarningFilled icons
682+ it ( "renders only one invalid icon when filterable" , ( ) => {
683+ const { container } = render ( MultiSelect , {
684+ props : {
685+ items,
686+ filterable : true ,
687+ invalid : true ,
688+ invalidText : "Invalid selection" ,
689+ } ,
690+ } ) ;
691+
692+ const icons = container . querySelectorAll ( ".bx--list-box__invalid-icon" ) ;
693+ expect ( icons ) . toHaveLength ( 1 ) ;
694+ } ) ;
695+
696+ // Regression: filterable + warn rendered two WarningAltFilled icons
697+ it ( "renders only one warning icon when filterable" , ( ) => {
698+ const { container } = render ( MultiSelect , {
699+ props : {
700+ items,
701+ filterable : true ,
702+ warn : true ,
703+ warnText : "Warning message" ,
704+ } ,
705+ } ) ;
706+
707+ const icons = container . querySelectorAll ( ".bx--list-box__invalid-icon" ) ;
708+ expect ( icons ) . toHaveLength ( 1 ) ;
709+ } ) ;
710+
681711 it ( "handles warning state" , ( ) => {
682712 render ( MultiSelect , {
683713 props : {
You can’t perform that action at this time.
0 commit comments