Files
mattermost-mobile/app/utils/server/server.test.ts
Elias Nahum 2a6bb1ddc1 [Gekidou] Show alert message when server is unsupported (#6764)
* Show alert message when server is unsupported

* set server min required version to 5.26.2
2022-11-18 12:18:11 +02:00

25 lines
796 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Alert} from 'react-native';
import {getIntlShape} from '@test/intl-test-helper';
import {unsupportedServer} from '.';
describe('Unsupported Server Alert', () => {
const intl = getIntlShape();
it('should show the alert for sysadmin', () => {
const alert = jest.spyOn(Alert, 'alert');
unsupportedServer('Default Server', true, intl);
expect(alert?.mock?.calls?.[0]?.[2]?.length).toBe(2);
});
it('should show the alert for team admin / user', () => {
const alert = jest.spyOn(Alert, 'alert');
unsupportedServer('Default Server', false, intl);
expect(alert?.mock?.calls?.[0]?.[2]?.length).toBe(1);
});
});