mattermost-mobile/app/screens/sso/sso.test.tsx
Daniel Espino García f4e6917185
Ensure no unresolved types in the definition files (#6521)
* Ensure no unresolved types in the definition files

* Address feedback and general cleanup

* Move import from @constants/x to @constants where relevant

* Remove unneeded "import as"
2022-08-05 14:36:19 +02:00

42 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {Preferences} from '@constants';
import LaunchType from '@constants/launch';
import {renderWithIntl} from '@test/intl-test-helper';
import SSOLogin from './index';
jest.mock('@screens/navigation', () => {
return {
getThemeFromState: () => 'light',
};
});
jest.mock('@utils/url', () => {
return {
tryOpenURL: () => true,
};
});
describe('SSO', () => {
const baseProps = {
componentId: 'SSO',
license: {
IsLicensed: 'true',
},
ssoType: 'GITLAB',
theme: Preferences.THEMES.denim,
serverUrl: 'https://locahost:8065',
serverDisplayName: 'Test Server',
launchType: LaunchType.Normal,
};
test('implement with OS browser & redirect url from version 5.33', async () => {
const props = {...baseProps, config: {Version: '5.36.0'}};
const {getByTestId} = renderWithIntl(<SSOLogin {...props}/>);
expect(getByTestId('sso.redirect_url')).toBeTruthy();
});
});