1import { getUserInterfaceStyle, setUserInterfaceStyle } from '../withIosUserInterfaceStyle'; 2 3describe('user interface style', () => { 4 // TODO: should we default to 'Light' just as we do in the client if none is specified? 5 it(`returns light if no userInterfaceStyle is provided`, () => { 6 expect(getUserInterfaceStyle({})).toBe('light'); 7 }); 8 9 it(`returns the value if provided`, () => { 10 expect(getUserInterfaceStyle({ userInterfaceStyle: 'light' })).toBe('light'); 11 }); 12 13 it(`returns the value under the ios key if provided`, () => { 14 expect( 15 getUserInterfaceStyle({ ios: { userInterfaceStyle: 'light' }, userInterfaceStyle: 'dark' }) 16 ).toBe('light'); 17 }); 18 19 it(`sets the UIUserInterfaceStyle to the appropriate value if given`, () => { 20 expect(setUserInterfaceStyle({ userInterfaceStyle: 'light' }, {})).toMatchObject({ 21 UIUserInterfaceStyle: 'Light', 22 }); 23 24 expect(setUserInterfaceStyle({ userInterfaceStyle: 'automatic' }, {})).toMatchObject({ 25 UIUserInterfaceStyle: 'Automatic', 26 }); 27 }); 28 29 // TODO: should we default to 'Light' just as we do in the client if none is specified? 30 it(`makes no changes to the infoPlist if the value is invalid`, () => { 31 expect( 32 setUserInterfaceStyle({ userInterfaceStyle: 'not-a-real-one' as any }, {}) 33 ).toMatchObject({}); 34 }); 35}); 36