forked from Ivasoft/mattermost-mobile
* Detox/E2E: Migrate to typescript * Add jest.config.js * Add moduleMapper to config.json * Add cookie jar to axios client, fix tsconfig.json and default_config.json * Take keyboard into consideration; clean test for now for this migration PR * Revert changes on path_builder * Attempt to fix dep issues * Update detox dep * Added missing @type dev dependencies * Fix dep order * Fix unit tests * Added dynamic year to email.ts
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import {renderWithIntlAndTheme} from '@test/intl-test-helper';
|
|
|
|
import Icon from './index';
|
|
|
|
describe('Server Icon', () => {
|
|
test('Server Icon Component should match snapshot', () => {
|
|
const {toJSON} = renderWithIntlAndTheme(
|
|
<Icon
|
|
hasUnreads={false}
|
|
mentionCount={0}
|
|
/>,
|
|
);
|
|
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
test('Server Icon Component should match snapshot with unreads', () => {
|
|
const {toJSON} = renderWithIntlAndTheme(
|
|
<Icon
|
|
hasUnreads={true}
|
|
mentionCount={0}
|
|
testID='server_icon'
|
|
/>,
|
|
);
|
|
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
test('Server Icon Component should match snapshot with mentions', () => {
|
|
const {toJSON} = renderWithIntlAndTheme(
|
|
<Icon
|
|
hasUnreads={false}
|
|
mentionCount={1}
|
|
testID='server_icon'
|
|
/>,
|
|
);
|
|
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
});
|