1import { ExecutionEnvironment } from 'expo-constants';
2import { unmockAllProperties } from 'jest-expo';
3
4import { describeManifest, mockConstants } from './ManifestTestUtils';
5
6beforeEach(() => {
7  unmockAllProperties();
8  jest.resetModules();
9  jest.resetAllMocks();
10});
11
12describeManifest({
13  extra: {
14    expoClient: {
15      name: 'wat',
16      slug: 'wat',
17      originalFullName: '@example/abc',
18    },
19  },
20})((manifestObj) => {
21  beforeEach(() => {
22    mockConstants(
23      {
24        executionEnvironment: ExecutionEnvironment.Standalone,
25      },
26      manifestObj
27    );
28  });
29
30  it(`returns correct redirect URL from getRedirectUrl`, () => {
31    const { getRedirectUrl } = require('../AuthSession');
32    expect(getRedirectUrl()).toEqual('https://auth.expo.io/@example/abc');
33  });
34});
35
36describeManifest({
37  extra: {
38    expoClient: {
39      name: 'wat',
40      slug: 'wat',
41      originalFullName: '@anonymous/abc',
42    },
43  },
44});
45