forked from Ivasoft/mattermost-mobile
* Servers logout and websocket state * addNewServer uility and rename file * add LaunchType for add new server * added time to LaunchProps type * Remove unnecessary props for launchToHome * Fix local action updateLastPostAt * Batch fetchProfilesPerChannels requests in chunks of 50 * WS handleUserAddedToChannelEvent to return early if no channelId is set * WS handleNewPostEvent to batch update last_post_at * add common actions to sync other servers * Entry actions to sync other servers data * Do not attempt to fetch notification data if payload does not contain a channelId * Set database as default at the end of the login flow * Handle logout when other servers remain * Handle Server options * Show alert when logging out from the account screen * Add workaround to have Lottie animate the loading component * Fix badge position in ServerIcon component * Server screen to support adding new server * Fix login screen to display error when credentials do not match * add localization strings * fix DatabaseProvider to update on server switch * Fix home icon and server icon subscriptions and badge display * Add dependencies to onLogout callback * feedback * Only updateLastPostAt if needed
25 lines
760 B
TypeScript
25 lines
760 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(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(false, intl);
|
|
expect(alert?.mock?.calls?.[0]?.[2]?.length).toBe(1);
|
|
});
|
|
});
|