@@ -4233,4 +4233,66 @@ describe('Config', () => {
42334233 expect ( value ) . toBe ( false ) ;
42344234 } ) ;
42354235 } ) ;
4236+
4237+ describe ( 'stickyHeader' , ( ) => {
4238+ it ( 'Should return TRUE when the configuration value is TRUE' , ( ) => {
4239+ // Setup
4240+ workspaceConfiguration . get . mockReturnValueOnce ( true ) ;
4241+
4242+ // Run
4243+ const value = config . stickyHeader ;
4244+
4245+ // Assert
4246+ expect ( workspaceConfiguration . get ) . toBeCalledWith ( 'stickyHeader' , true ) ;
4247+ expect ( value ) . toBe ( true ) ;
4248+ } ) ;
4249+
4250+ it ( 'Should return FALSE when the configuration value is FALSE' , ( ) => {
4251+ // Setup
4252+ workspaceConfiguration . get . mockReturnValueOnce ( false ) ;
4253+
4254+ // Run
4255+ const value = config . stickyHeader ;
4256+
4257+ // Assert
4258+ expect ( workspaceConfiguration . get ) . toBeCalledWith ( 'stickyHeader' , true ) ;
4259+ expect ( value ) . toBe ( false ) ;
4260+ } ) ;
4261+
4262+ it ( 'Should return TRUE when the configuration value is truthy' , ( ) => {
4263+ // Setup
4264+ workspaceConfiguration . get . mockReturnValueOnce ( 5 ) ;
4265+
4266+ // Run
4267+ const value = config . stickyHeader ;
4268+
4269+ // Assert
4270+ expect ( workspaceConfiguration . get ) . toBeCalledWith ( 'stickyHeader' , true ) ;
4271+ expect ( value ) . toBe ( true ) ;
4272+ } ) ;
4273+
4274+ it ( 'Should return FALSE when the configuration value is falsy' , ( ) => {
4275+ // Setup
4276+ workspaceConfiguration . get . mockReturnValueOnce ( 0 ) ;
4277+
4278+ // Run
4279+ const value = config . stickyHeader ;
4280+
4281+ // Assert
4282+ expect ( workspaceConfiguration . get ) . toBeCalledWith ( 'stickyHeader' , true ) ;
4283+ expect ( value ) . toBe ( false ) ;
4284+ } ) ;
4285+
4286+ it ( 'Should return the default value (TRUE) when the configuration value is not set' , ( ) => {
4287+ // Setup
4288+ workspaceConfiguration . get . mockImplementationOnce ( ( _ , defaultValue ) => defaultValue ) ;
4289+
4290+ // Run
4291+ const value = config . stickyHeader ;
4292+
4293+ // Assert
4294+ expect ( workspaceConfiguration . get ) . toBeCalledWith ( 'stickyHeader' , true ) ;
4295+ expect ( value ) . toBe ( true ) ;
4296+ } ) ;
4297+ } ) ;
42364298} ) ;
0 commit comments