diff options
Diffstat (limited to 'webapp/tests')
-rw-r--r-- | webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap | 237 | ||||
-rw-r--r-- | webapp/tests/components/shortcuts_modal.test.jsx | 25 |
2 files changed, 262 insertions, 0 deletions
diff --git a/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap b/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap new file mode 100644 index 000000000..cfe719ba4 --- /dev/null +++ b/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap @@ -0,0 +1,237 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/ShortcutsModal should match snapshot modal for Mac 1`] = ` +<InjectIntl(ShortcutsModal) + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "textComponent": "span", + } + } + isMac={true} +> + <ShortcutsModal + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "textComponent": "span", + } + } + isMac={true} + > + <Modal + animation={true} + autoFocus={true} + backdrop={true} + bsClass="modal" + dialogClassName="shortcuts-modal" + dialogComponentClass={[Function]} + enforceFocus={true} + keyboard={true} + manager={ + ModalManager { + "add": [Function], + "containers": Array [], + "data": Array [], + "handleContainerOverflow": true, + "hideSiblingNodes": true, + "isTopModal": [Function], + "modals": Array [], + "remove": [Function], + } + } + onExited={[Function]} + onHide={[Function]} + renderBackdrop={[Function]} + restoreFocus={true} + show={false} + > + <Modal + autoFocus={true} + backdrop={true} + backdropClassName="modal-backdrop" + backdropTransitionTimeout={150} + containerClassName="modal-open" + dialogTransitionTimeout={300} + enforceFocus={true} + keyboard={true} + manager={ + ModalManager { + "add": [Function], + "containers": Array [], + "data": Array [], + "handleContainerOverflow": true, + "hideSiblingNodes": true, + "isTopModal": [Function], + "modals": Array [], + "remove": [Function], + } + } + onEntering={[Function]} + onExited={[Function]} + onHide={[Function]} + renderBackdrop={[Function]} + restoreFocus={true} + show={false} + transition={[Function]} + /> + </Modal> + </ShortcutsModal> +</InjectIntl(ShortcutsModal)> +`; + +exports[`components/ShortcutsModal should match snapshot modal for non-Mac like Windows/Linux 1`] = ` +<InjectIntl(ShortcutsModal) + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "textComponent": "span", + } + } + isMac={false} +> + <ShortcutsModal + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "textComponent": "span", + } + } + isMac={false} + > + <Modal + animation={true} + autoFocus={true} + backdrop={true} + bsClass="modal" + dialogClassName="shortcuts-modal" + dialogComponentClass={[Function]} + enforceFocus={true} + keyboard={true} + manager={ + ModalManager { + "add": [Function], + "containers": Array [], + "data": Array [], + "handleContainerOverflow": true, + "hideSiblingNodes": true, + "isTopModal": [Function], + "modals": Array [], + "remove": [Function], + } + } + onExited={[Function]} + onHide={[Function]} + renderBackdrop={[Function]} + restoreFocus={true} + show={false} + > + <Modal + autoFocus={true} + backdrop={true} + backdropClassName="modal-backdrop" + backdropTransitionTimeout={150} + containerClassName="modal-open" + dialogTransitionTimeout={300} + enforceFocus={true} + keyboard={true} + manager={ + ModalManager { + "add": [Function], + "containers": Array [], + "data": Array [], + "handleContainerOverflow": true, + "hideSiblingNodes": true, + "isTopModal": [Function], + "modals": Array [], + "remove": [Function], + } + } + onEntering={[Function]} + onExited={[Function]} + onHide={[Function]} + renderBackdrop={[Function]} + restoreFocus={true} + show={false} + transition={[Function]} + /> + </Modal> + </ShortcutsModal> +</InjectIntl(ShortcutsModal)> +`; diff --git a/webapp/tests/components/shortcuts_modal.test.jsx b/webapp/tests/components/shortcuts_modal.test.jsx new file mode 100644 index 000000000..04fa51a76 --- /dev/null +++ b/webapp/tests/components/shortcuts_modal.test.jsx @@ -0,0 +1,25 @@ +// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import React from 'react'; + +import {mountWithIntl} from 'tests/helpers/intl-test-helper.jsx'; +import ShortcutsModal from 'components/shortcuts_modal.jsx'; + +describe('components/ShortcutsModal', () => { + test('should match snapshot modal for Mac', () => { + const wrapper = mountWithIntl( + <ShortcutsModal isMac={true}/> + ); + + expect(wrapper).toMatchSnapshot(); + }); + + test('should match snapshot modal for non-Mac like Windows/Linux', () => { + const wrapper = mountWithIntl( + <ShortcutsModal isMac={false}/> + ); + + expect(wrapper).toMatchSnapshot(); + }); +}); |