* Add linter rules for import order and type member delimiters * Remove unneeded group * Group all app/* imports before the internal imports * Move app/ imports before parent imports * Separate @node_modules imports into a different group * Substitute app paths by aliases * Fix @node_modules import order and add test related modules * Add aliases for types and test, and group import types
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import CustomStatusEmoji from '@components/custom_status/custom_status_emoji';
|
|
import {CustomStatusDuration} from '@mm-redux/types/users';
|
|
import * as CustomStatusSelectors from '@selectors/custom_status';
|
|
import {renderWithRedux} from '@test/testing_library';
|
|
|
|
jest.mock('@selectors/custom_status');
|
|
|
|
describe('components/custom_status/custom_status_emoji', () => {
|
|
const getCustomStatus = () => {
|
|
return {
|
|
emoji: 'calendar',
|
|
text: 'In a meeting',
|
|
duration: CustomStatusDuration.DONT_CLEAR,
|
|
};
|
|
};
|
|
(CustomStatusSelectors.makeGetCustomStatus as jest.Mock).mockReturnValue(getCustomStatus);
|
|
it('should match snapshot', () => {
|
|
const wrapper = renderWithRedux(
|
|
<CustomStatusEmoji/>,
|
|
);
|
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should match snapshot with props', () => {
|
|
const wrapper = renderWithRedux(
|
|
<CustomStatusEmoji
|
|
emojiSize={34}
|
|
/>,
|
|
);
|
|
|
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should not render when getCustomStatus returns null', () => {
|
|
(CustomStatusSelectors.makeGetCustomStatus as jest.Mock).mockReturnValue(() => null);
|
|
const wrapper = renderWithRedux(
|
|
<CustomStatusEmoji/>,
|
|
);
|
|
|
|
expect(wrapper.toJSON()).toBeNull();
|
|
});
|
|
});
|