@@ -45,7 +45,7 @@ describe('SwitchComponent', () => {
4545
4646 it ( 'should select an option and emit selected value' , ( ) => {
4747 component . options = mockOptions ;
48- component . selectedValue = mockOptions [ 0 ] . value ;
48+ component . onOptionClick ( mockOptions [ 0 ] . value ) ;
4949 fixture . detectChanges ( ) ;
5050
5151 spyOn ( component . selectedValueChange , 'emit' ) ;
@@ -60,7 +60,7 @@ describe('SwitchComponent', () => {
6060
6161 it ( 'should apply the correct background color class' , ( ) => {
6262 component . options = mockOptions ;
63- component . selectedValue = mockOptions [ 1 ] . value ;
63+ component . onOptionClick ( mockOptions [ 1 ] . value ) ;
6464 fixture . detectChanges ( ) ;
6565
6666 const containerElement = fixture . debugElement . query ( By . css ( '.switch-container' ) ) ;
@@ -69,7 +69,7 @@ describe('SwitchComponent', () => {
6969
7070 it ( 'should apply the correct icon color class for selected option' , ( ) => {
7171 component . options = mockOptions ;
72- component . selectedValue = mockOptions [ 1 ] . value ;
72+ component . onOptionClick ( mockOptions [ 1 ] . value ) ;
7373 fixture . detectChanges ( ) ;
7474
7575 const iconElement = fixture . debugElement . query ( By . css ( '.switch-opt .icon-2' ) ) ;
@@ -78,7 +78,7 @@ describe('SwitchComponent', () => {
7878
7979 it ( 'should display the correct label with the selected color' , ( ) => {
8080 component . options = mockOptions ;
81- component . selectedValue = mockOptions [ 1 ] . value ;
81+ component . onOptionClick ( mockOptions [ 1 ] . value ) ;
8282 fixture . detectChanges ( ) ;
8383
8484 const labelElement = fixture . debugElement . query ( By . css ( '.visibility-label' ) ) ;
@@ -88,7 +88,7 @@ describe('SwitchComponent', () => {
8888
8989 it ( 'should apply bg-white class to selected option' , ( ) => {
9090 component . options = mockOptions ;
91- component . selectedValue = mockOptions [ 1 ] . value ;
91+ component . onOptionClick ( mockOptions [ 1 ] . value ) ;
9292 fixture . detectChanges ( ) ;
9393
9494 const selectedOptionElement = fixture . debugElement . query ( By . css ( '.switch-opt.bg-white' ) ) ;
0 commit comments