import { UiSettingsParams } from '../../../types' ; import { getAccessibilitySettings } from './accessibility' ; describe ( 'accessibility settings' , ( ) => { const accessibilitySettings = getAccessibilitySettings ( ) ; const getValidationFn = ( setting ) => ( value ) => setting . schema . validate ( value ) ; describe ( 'accessibility:disableAnimations' , ( ) => { const validate = getValidationFn ( accessibilitySettings [ 'accessibility:disableAnimations' ] ) ; it ( 'should only accept boolean' , ( ) => { expect ( ( ) => validate ( true ) ) . not . toThrow ( ) ; expect ( ( ) => validate ( false ) ) . not . toThrow ( ) ; expect ( ( ) => validate ( 42 ) ) . toThrowErrorMatchingInlineSnapshot ( `"expected value of type [boolean] but got [number]"` ) ; expect ( ( ) => validate ( 'foo' ) ) . toThrowErrorMatchingInlineSnapshot ( `"expected value of type [boolean] but got [string]"` ) ; } ) ; } ) ; } ) ;