@@ -189,6 +189,30 @@ test(`When user selected theme is auto, getInitialStateForIcon should return cor
189
189
expect ( getInitialStateForIcon ( ) ) . toEqual ( [ 10 , 0 , 33 , 0 ] ) ;
190
190
} ) ;
191
191
192
+ test ( `When current theme is light and new theme is dark, createEvent should create event with proper details` , ( ) => {
193
+ const instance = new themeSwitchClass ( ) ;
194
+ const result = instance . createEvent ( THEME_LIGHT , THEME_DARK ) ;
195
+ expect ( result . detail . originId ) . toBe ( instance . identifier ) ;
196
+ expect ( result . detail . oldState ) . toBe ( THEME_LIGHT ) ;
197
+ expect ( result . detail . newState ) . toBe ( THEME_DARK ) ;
198
+ } ) ;
199
+
200
+ test ( `When current theme is dark and new theme is auto, createEvent should create event with proper details` , ( ) => {
201
+ const instance = new themeSwitchClass ( ) ;
202
+ const result = instance . createEvent ( THEME_DARK , THEME_AUTO ) ;
203
+ expect ( result . detail . originId ) . toBe ( instance . identifier ) ;
204
+ expect ( result . detail . oldState ) . toBe ( THEME_DARK ) ;
205
+ expect ( result . detail . newState ) . toBe ( THEME_AUTO ) ;
206
+ } ) ;
207
+
208
+ test ( `When current theme is auto and new theme is light, createEvent should create event with proper details` , ( ) => {
209
+ const instance = new themeSwitchClass ( ) ;
210
+ const result = instance . createEvent ( THEME_AUTO , THEME_LIGHT ) ;
211
+ expect ( result . detail . originId ) . toBe ( instance . identifier ) ;
212
+ expect ( result . detail . oldState ) . toBe ( THEME_AUTO ) ;
213
+ expect ( result . detail . newState ) . toBe ( THEME_LIGHT ) ;
214
+ } ) ;
215
+
192
216
describe ( "Screenshot tests" , ( ) => {
193
217
// Increase the timeout of executing all the test suit from
194
218
// the default 5000 to a greater value to run fine on CI
0 commit comments