mattermost-mobile/app/utils/server/server.test.ts
Mattermost Build 5dcdbf3116
Remove end user message for unsupported servers (#8404) (#8409)
* Remove end user message for unsupported servers

* Update test

(cherry picked from commit da38976cff)

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2024-12-12 14:06:55 +02:00

24 lines
776 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 '@utils/general';
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 not show the alert for team admin / user', () => {
const alert = jest.spyOn(Alert, 'alert');
unsupportedServer('Default Server', false, intl);
expect(alert).not.toHaveBeenCalled();
});
});