1import { Platform } from 'expo-modules-core'; 2 3import { makeRedirectUri } from '../AuthSession'; 4 5describe('Web and SSR', () => { 6 it(`Creates a redirect URL`, () => { 7 expect(makeRedirectUri()).toBe(Platform.isDOMAvailable ? 'http://localhost' : ''); 8 }); 9 10 it(`Creates a redirect URL with a custom path`, () => { 11 expect(makeRedirectUri({ path: 'bacon' })).toBe( 12 Platform.isDOMAvailable ? 'http://localhost/bacon' : '' 13 ); 14 }); 15 16 it(`Creates a redirect URL with useProxy`, () => { 17 // The expected behavior is to be more forgiving and skip the useProxy error since it isn't available on web. 18 expect(makeRedirectUri({ path: 'bacon', useProxy: true })).toBe( 19 Platform.isDOMAvailable ? 'http://localhost/bacon' : '' 20 ); 21 }); 22}); 23