summaryrefslogtreecommitdiffstats
path: root/webapp/tests/components
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/tests/components')
-rw-r--r--webapp/tests/components/__snapshots__/about_build_modal.test.jsx.snap370
-rw-r--r--webapp/tests/components/__snapshots__/new_channel_modal.test.jsx.snap751
-rw-r--r--webapp/tests/components/__snapshots__/reset_status_modal.test.jsx.snap54
-rw-r--r--webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap237
-rw-r--r--webapp/tests/components/__snapshots__/spinner_button.test.jsx.snap27
-rw-r--r--webapp/tests/components/about_build_modal.test.jsx129
-rw-r--r--webapp/tests/components/admin_console/__snapshots__/color_setting.test.jsx.snap95
-rw-r--r--webapp/tests/components/admin_console/color_setting.test.jsx55
-rw-r--r--webapp/tests/components/admin_console/request_button/__snapshots__/request_button.test.jsx.snap496
-rw-r--r--webapp/tests/components/admin_console/request_button/request_button.test.jsx215
-rw-r--r--webapp/tests/components/backstage/components/__snapshots__/backstage_header.test.jsx.snap31
-rw-r--r--webapp/tests/components/backstage/components/backstage_header.test.jsx26
-rw-r--r--webapp/tests/components/integrations/__snapshots__/add_command.test.jsx.snap396
-rw-r--r--webapp/tests/components/integrations/__snapshots__/add_incoming_hook.test.jsx.snap26
-rw-r--r--webapp/tests/components/integrations/__snapshots__/add_oauth_app.test.jsx.snap613
-rw-r--r--webapp/tests/components/integrations/__snapshots__/add_outgoing_hook.test.jsx.snap27
-rw-r--r--webapp/tests/components/integrations/__snapshots__/edit_command.test.jsx.snap424
-rw-r--r--webapp/tests/components/integrations/__snapshots__/edit_incoming_hook.test.jsx.snap7
-rw-r--r--webapp/tests/components/integrations/__snapshots__/edit_outgoing_hook.test.jsx.snap7
-rw-r--r--webapp/tests/components/integrations/__snapshots__/installed_command.test.jsx.snap103
-rw-r--r--webapp/tests/components/integrations/__snapshots__/installed_oauth_app.test.jsx.snap155
-rw-r--r--webapp/tests/components/integrations/__snapshots__/installed_oauth_apps.test.jsx.snap100
-rw-r--r--webapp/tests/components/integrations/add_command.test.jsx30
-rw-r--r--webapp/tests/components/integrations/add_incoming_hook.test.jsx29
-rw-r--r--webapp/tests/components/integrations/add_oauth_app.test.jsx81
-rw-r--r--webapp/tests/components/integrations/add_outgoing_hook.test.jsx29
-rw-r--r--webapp/tests/components/integrations/edit_command.test.jsx36
-rw-r--r--webapp/tests/components/integrations/edit_incoming_hook.test.jsx30
-rw-r--r--webapp/tests/components/integrations/edit_outgoing_hook.test.jsx31
-rw-r--r--webapp/tests/components/integrations/installed_command.test.jsx83
-rw-r--r--webapp/tests/components/integrations/installed_oauth_app.test.jsx71
-rw-r--r--webapp/tests/components/integrations/installed_oauth_apps.test.jsx57
-rw-r--r--webapp/tests/components/new_channel_modal.test.jsx79
-rw-r--r--webapp/tests/components/post_view/post_info/__snapshots__/post_info.test.jsx.snap515
-rw-r--r--webapp/tests/components/post_view/post_info/post_info.test.jsx225
-rw-r--r--webapp/tests/components/reset_status_modal.test.jsx29
-rw-r--r--webapp/tests/components/shortcuts_modal.test.jsx25
-rw-r--r--webapp/tests/components/spinner_button.test.jsx53
-rw-r--r--webapp/tests/components/suggestion/suggestion_box.test.jsx16
39 files changed, 0 insertions, 5763 deletions
diff --git a/webapp/tests/components/__snapshots__/about_build_modal.test.jsx.snap b/webapp/tests/components/__snapshots__/about_build_modal.test.jsx.snap
deleted file mode 100644
index b45b6b7f0..000000000
--- a/webapp/tests/components/__snapshots__/about_build_modal.test.jsx.snap
+++ /dev/null
@@ -1,370 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/AboutBuildModal should match snapshot for enterprise edition 1`] = `
-<Modal
- animation={true}
- autoFocus={true}
- backdrop={true}
- bsClass="modal"
- dialogClassName="about-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],
- }
- }
- onHide={[Function]}
- renderBackdrop={[Function]}
- restoreFocus={true}
- show={true}
->
- <ModalHeader
- bsClass="modal-header"
- closeButton={true}
- closeLabel="Close"
- >
- <ModalTitle
- bsClass="modal-title"
- componentClass="h4"
- >
- <FormattedMessage
- defaultMessage="About Mattermost"
- id="about.title"
- values={Object {}}
- />
- </ModalTitle>
- </ModalHeader>
- <ModalBody
- bsClass="modal-body"
- componentClass="div"
- >
- <div
- className="about-modal__content"
- >
- <div
- className="about-modal__logo"
- >
- <span
- className="icon"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'> <style type='text/css'> .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#222222;} </style> <g id='XMLID_1_'> <g id='XMLID_3_'> <path id='XMLID_4_' class='st0' d='M396.9,47.7l2.6,53.1c43,47.5,60,114.8,38.6,178.1c-32,94.4-137.4,144.1-235.4,110.9 S51.1,253.1,83,158.7C104.5,95.2,159.2,52,222.5,40.5l34.2-40.4C150-2.8,49.3,63.4,13.3,169.9C-31,300.6,39.1,442.5,169.9,486.7 s272.6-25.8,316.9-156.6C522.7,223.9,483.1,110.3,396.9,47.7z'/> </g> <path id='XMLID_2_' class='st0' d='M335.6,204.3l-1.8-74.2l-1.5-42.7l-1-37c0,0,0.2-17.8-0.4-22c-0.1-0.9-0.4-1.6-0.7-2.2 c0-0.1-0.1-0.2-0.1-0.3c0-0.1-0.1-0.2-0.1-0.2c-0.7-1.2-1.8-2.1-3.1-2.6c-1.4-0.5-2.9-0.4-4.2,0.2c0,0-0.1,0-0.1,0 c-0.2,0.1-0.3,0.1-0.4,0.2c-0.6,0.3-1.2,0.7-1.8,1.3c-3,3-13.7,17.2-13.7,17.2l-23.2,28.8l-27.1,33l-46.5,57.8 c0,0-21.3,26.6-16.6,59.4s29.1,48.7,48,55.1c18.9,6.4,48,8.5,71.6-14.7C336.4,238.4,335.6,204.3,335.6,204.3z'/> </g> </svg>",
- }
- }
- />
- </div>
- <div>
- <h3
- className="about-modal__title"
- >
- Mattermost
-
- <FormattedMessage
- defaultMessage="Enterprise Edition"
- id="about.teamEditiont1"
- values={Object {}}
- />
- </h3>
- <p
- className="about-modal__subtitle padding-bottom"
- >
- <FormattedMessage
- defaultMessage="Modern communication from behind your firewall."
- id="about.enterpriseEditionSt"
- values={Object {}}
- />
- </p>
- <div
- className="form-group less"
- >
- <div>
- <FormattedMessage
- defaultMessage="Version:"
- id="about.version"
- values={Object {}}
- />
- <span
- id="versionString"
- >
-  3.6.0  (3.6.2)
- </span>
- </div>
- <div>
- <FormattedMessage
- defaultMessage="Database:"
- id="about.database"
- values={Object {}}
- />
-  Postgres
- </div>
- </div>
- </div>
- </div>
- <div
- className="about-modal__footer"
- >
- <div>
- <FormattedMessage
- defaultMessage="Learn more about Enterprise Edition at "
- id="about.enterpriseEditionLearn"
- values={Object {}}
- />
- <a
- href="http://about.mattermost.com/"
- rel="noopener noreferrer"
- target="_blank"
- >
- about.mattermost.com
- </a>
- </div>
- <div
- className="form-group about-modal__copyright"
- >
- <FormattedMessage
- defaultMessage="Copyright 2015 - {currentYear} Mattermost, Inc. All rights reserved"
- id="about.copyright"
- values={
- Object {
- "currentYear": 2017,
- }
- }
- />
- </div>
- </div>
- <div
- className="about-modal__notice form-group padding-top x2"
- >
- <p>
- <FormattedHTMLMessage
- defaultMessage="Mattermost is made possible by the open source software used in our <a href=\\"https://about.mattermost.com/platform-notice-txt/\\" target=\\"_blank\\">platform</a>, <a href=\\"https://about.mattermost.com/desktop-notice-txt/\\" target=\\"_blank\\">desktop</a> and <a href=\\"https://about.mattermost.com/mobile-notice-txt/\\" target=\\"_blank\\">mobile</a> apps."
- id="about.notice"
- values={Object {}}
- />
- </p>
- </div>
- <div
- className="about-modal__hash"
- >
- <p>
- <FormattedMessage
- defaultMessage="Build Hash:"
- id="about.hash"
- values={Object {}}
- />
-  
- abcdef1234567890
- <br />
- <FormattedMessage
- defaultMessage="EE Build Hash:"
- id="about.hashee"
- values={Object {}}
- />
-  
- 0123456789abcdef
- </p>
- <p>
- <FormattedMessage
- defaultMessage="Build Date:"
- id="about.date"
- values={Object {}}
- />
-  
- 21 January 2017
- </p>
- </div>
- </ModalBody>
-</Modal>
-`;
-
-exports[`components/AboutBuildModal should match snapshot for team edition 1`] = `
-<Modal
- animation={true}
- autoFocus={true}
- backdrop={true}
- bsClass="modal"
- dialogClassName="about-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],
- }
- }
- onHide={[Function]}
- renderBackdrop={[Function]}
- restoreFocus={true}
- show={true}
->
- <ModalHeader
- bsClass="modal-header"
- closeButton={true}
- closeLabel="Close"
- >
- <ModalTitle
- bsClass="modal-title"
- componentClass="h4"
- >
- <FormattedMessage
- defaultMessage="About Mattermost"
- id="about.title"
- values={Object {}}
- />
- </ModalTitle>
- </ModalHeader>
- <ModalBody
- bsClass="modal-body"
- componentClass="div"
- >
- <div
- className="about-modal__content"
- >
- <div
- className="about-modal__logo"
- >
- <span
- className="icon"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'> <style type='text/css'> .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#222222;} </style> <g id='XMLID_1_'> <g id='XMLID_3_'> <path id='XMLID_4_' class='st0' d='M396.9,47.7l2.6,53.1c43,47.5,60,114.8,38.6,178.1c-32,94.4-137.4,144.1-235.4,110.9 S51.1,253.1,83,158.7C104.5,95.2,159.2,52,222.5,40.5l34.2-40.4C150-2.8,49.3,63.4,13.3,169.9C-31,300.6,39.1,442.5,169.9,486.7 s272.6-25.8,316.9-156.6C522.7,223.9,483.1,110.3,396.9,47.7z'/> </g> <path id='XMLID_2_' class='st0' d='M335.6,204.3l-1.8-74.2l-1.5-42.7l-1-37c0,0,0.2-17.8-0.4-22c-0.1-0.9-0.4-1.6-0.7-2.2 c0-0.1-0.1-0.2-0.1-0.3c0-0.1-0.1-0.2-0.1-0.2c-0.7-1.2-1.8-2.1-3.1-2.6c-1.4-0.5-2.9-0.4-4.2,0.2c0,0-0.1,0-0.1,0 c-0.2,0.1-0.3,0.1-0.4,0.2c-0.6,0.3-1.2,0.7-1.8,1.3c-3,3-13.7,17.2-13.7,17.2l-23.2,28.8l-27.1,33l-46.5,57.8 c0,0-21.3,26.6-16.6,59.4s29.1,48.7,48,55.1c18.9,6.4,48,8.5,71.6-14.7C336.4,238.4,335.6,204.3,335.6,204.3z'/> </g> </svg>",
- }
- }
- />
- </div>
- <div>
- <h3
- className="about-modal__title"
- >
- Mattermost
-
- <FormattedMessage
- defaultMessage="Team Edition"
- id="about.teamEditiont0"
- values={Object {}}
- />
- </h3>
- <p
- className="about-modal__subtitle padding-bottom"
- >
- <FormattedMessage
- defaultMessage="All your team communication in one place, instantly searchable and accessible anywhere."
- id="about.teamEditionSt"
- values={Object {}}
- />
- </p>
- <div
- className="form-group less"
- >
- <div>
- <FormattedMessage
- defaultMessage="Version:"
- id="about.version"
- values={Object {}}
- />
- <span
- id="versionString"
- >
-  3.6.0  (3.6.2)
- </span>
- </div>
- <div>
- <FormattedMessage
- defaultMessage="Database:"
- id="about.database"
- values={Object {}}
- />
-  Postgres
- </div>
- </div>
- </div>
- </div>
- <div
- className="about-modal__footer"
- >
- <div>
- <FormattedMessage
- defaultMessage="Join the Mattermost community at "
- id="about.teamEditionLearn"
- values={Object {}}
- />
- <a
- href="http://www.mattermost.org/"
- rel="noopener noreferrer"
- target="_blank"
- >
- mattermost.org
- </a>
- </div>
- <div
- className="form-group about-modal__copyright"
- >
- <FormattedMessage
- defaultMessage="Copyright 2015 - {currentYear} Mattermost, Inc. All rights reserved"
- id="about.copyright"
- values={
- Object {
- "currentYear": 2017,
- }
- }
- />
- </div>
- </div>
- <div
- className="about-modal__notice form-group padding-top x2"
- >
- <p>
- <FormattedHTMLMessage
- defaultMessage="Mattermost is made possible by the open source software used in our <a href=\\"https://about.mattermost.com/platform-notice-txt/\\" target=\\"_blank\\">platform</a>, <a href=\\"https://about.mattermost.com/desktop-notice-txt/\\" target=\\"_blank\\">desktop</a> and <a href=\\"https://about.mattermost.com/mobile-notice-txt/\\" target=\\"_blank\\">mobile</a> apps."
- id="about.notice"
- values={Object {}}
- />
- </p>
- </div>
- <div
- className="about-modal__hash"
- >
- <p>
- <FormattedMessage
- defaultMessage="Build Hash:"
- id="about.hash"
- values={Object {}}
- />
-  
- abcdef1234567890
- <br />
- <FormattedMessage
- defaultMessage="EE Build Hash:"
- id="about.hashee"
- values={Object {}}
- />
-  
- </p>
- <p>
- <FormattedMessage
- defaultMessage="Build Date:"
- id="about.date"
- values={Object {}}
- />
-  
- 21 January 2017
- </p>
- </div>
- </ModalBody>
-</Modal>
-`;
diff --git a/webapp/tests/components/__snapshots__/new_channel_modal.test.jsx.snap b/webapp/tests/components/__snapshots__/new_channel_modal.test.jsx.snap
deleted file mode 100644
index c5582dc7d..000000000
--- a/webapp/tests/components/__snapshots__/new_channel_modal.test.jsx.snap
+++ /dev/null
@@ -1,751 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/NewChannelModal should match snapshot, modal not showing 1`] = `
-<span>
- <Modal
- animation={true}
- autoFocus={true}
- backdrop={true}
- bsClass="modal"
- bsSize="large"
- dialogClassName="new-channel__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],
- }
- }
- onHide={[Function]}
- renderBackdrop={[Function]}
- restoreFocus={true}
- show={true}
- >
- <ModalHeader
- bsClass="modal-header"
- closeButton={true}
- closeLabel="Close"
- >
- <ModalTitle
- bsClass="modal-title"
- componentClass="h4"
- >
- <FormattedMessage
- defaultMessage="New Channel"
- id="channel_modal.modalTitle"
- values={Object {}}
- />
- </ModalTitle>
- </ModalHeader>
- <form
- className="form-horizontal"
- role="form"
- >
- <ModalBody
- bsClass="modal-body"
- componentClass="div"
- >
- <div>
- <div
- className="modal-intro"
- >
- <FormattedMessage
- defaultMessage="Create a new public channel anyone can join. "
- id="channel_modal.publicChannel2"
- values={Object {}}
- />
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Create a private channel"
- id="channel_modal.privateGroup2"
- values={Object {}}
- />
- </a>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="col-sm-3 form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Name"
- id="channel_modal.name"
- values={Object {}}
- />
- </label>
- <div
- className="col-sm-9"
- >
- <input
- autoFocus={true}
- className="form-control"
- id="newPublicChannelName"
- maxLength={22}
- onChange={[Function]}
- placeholder="E.g.: \\"Bugs\\", \\"Marketing\\", \\"客户支持\\""
- tabIndex="1"
- type="text"
- value="testchannel"
- />
- <p
- className="input__help dark"
- >
- URL: /testchannel (
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Edit"
- id="channel_modal.edit"
- values={Object {}}
- />
- </a>
- )
- </p>
- </div>
- </div>
- <div
- className="form-group"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Purpose"
- id="channel_modal.purpose"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPublicChannelPurpose"
- maxLength="250"
- onChange={[Function]}
- placeholder="E.g.: \\"A channel to file bugs and improvements\\""
- rows="4"
- tabIndex="2"
- value=""
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Describe how this channel should be used."
- id="channel_modal.descriptionHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- <div
- className="form-group less"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Header"
- id="channel_modal.header"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPublicChannelHeader"
- maxLength="1024"
- onChange={[Function]}
- placeholder="E.g.: \\"[Link Title](http://example.com)\\""
- rows="4"
- tabIndex="2"
- value=""
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Set text that will appear in the header of the channel beside the channel name. For example, include frequently used links by typing [Link Title](http://example.com)."
- id="channel_modal.headerHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- </ModalBody>
- <ModalFooter
- bsClass="modal-footer"
- componentClass="div"
- >
- <button
- className="btn btn-default"
- onClick={[Function]}
- type="button"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="channel_modal.cancel"
- values={Object {}}
- />
- </button>
- <button
- className="btn btn-primary"
- onClick={[Function]}
- tabIndex="3"
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Create New Channel"
- id="channel_modal.createNew"
- values={Object {}}
- />
- </button>
- </ModalFooter>
- </form>
- </Modal>
-</span>
-`;
-
-exports[`components/NewChannelModal should match snapshot, modal showing 1`] = `
-<span>
- <Modal
- animation={true}
- autoFocus={true}
- backdrop={true}
- bsClass="modal"
- bsSize="large"
- dialogClassName="new-channel__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],
- }
- }
- onHide={[Function]}
- renderBackdrop={[Function]}
- restoreFocus={true}
- show={true}
- >
- <ModalHeader
- bsClass="modal-header"
- closeButton={true}
- closeLabel="Close"
- >
- <ModalTitle
- bsClass="modal-title"
- componentClass="h4"
- >
- <FormattedMessage
- defaultMessage="New Channel"
- id="channel_modal.modalTitle"
- values={Object {}}
- />
- </ModalTitle>
- </ModalHeader>
- <form
- className="form-horizontal"
- role="form"
- >
- <ModalBody
- bsClass="modal-body"
- componentClass="div"
- >
- <div>
- <div
- className="modal-intro"
- >
- <FormattedMessage
- defaultMessage="Create a new public channel anyone can join. "
- id="channel_modal.publicChannel2"
- values={Object {}}
- />
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Create a private channel"
- id="channel_modal.privateGroup2"
- values={Object {}}
- />
- </a>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="col-sm-3 form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Name"
- id="channel_modal.name"
- values={Object {}}
- />
- </label>
- <div
- className="col-sm-9"
- >
- <input
- autoFocus={true}
- className="form-control"
- id="newPublicChannelName"
- maxLength={22}
- onChange={[Function]}
- placeholder="E.g.: \\"Bugs\\", \\"Marketing\\", \\"客户支持\\""
- tabIndex="1"
- type="text"
- value="testchannel"
- />
- <p
- className="input__help dark"
- >
- URL: /testchannel (
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Edit"
- id="channel_modal.edit"
- values={Object {}}
- />
- </a>
- )
- </p>
- </div>
- </div>
- <div
- className="form-group"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Purpose"
- id="channel_modal.purpose"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPublicChannelPurpose"
- maxLength="250"
- onChange={[Function]}
- placeholder="E.g.: \\"A channel to file bugs and improvements\\""
- rows="4"
- tabIndex="2"
- value=""
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Describe how this channel should be used."
- id="channel_modal.descriptionHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- <div
- className="form-group less"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Header"
- id="channel_modal.header"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPublicChannelHeader"
- maxLength="1024"
- onChange={[Function]}
- placeholder="E.g.: \\"[Link Title](http://example.com)\\""
- rows="4"
- tabIndex="2"
- value=""
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Set text that will appear in the header of the channel beside the channel name. For example, include frequently used links by typing [Link Title](http://example.com)."
- id="channel_modal.headerHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- </ModalBody>
- <ModalFooter
- bsClass="modal-footer"
- componentClass="div"
- >
- <button
- className="btn btn-default"
- onClick={[Function]}
- type="button"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="channel_modal.cancel"
- values={Object {}}
- />
- </button>
- <button
- className="btn btn-primary"
- onClick={[Function]}
- tabIndex="3"
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Create New Channel"
- id="channel_modal.createNew"
- values={Object {}}
- />
- </button>
- </ModalFooter>
- </form>
- </Modal>
-</span>
-`;
-
-exports[`components/NewChannelModal should match snapshot, private channel filled in header and purpose 1`] = `
-<span>
- <Modal
- animation={true}
- autoFocus={true}
- backdrop={true}
- bsClass="modal"
- bsSize="large"
- dialogClassName="new-channel__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],
- }
- }
- onHide={[Function]}
- renderBackdrop={[Function]}
- restoreFocus={true}
- show={true}
- >
- <ModalHeader
- bsClass="modal-header"
- closeButton={true}
- closeLabel="Close"
- >
- <ModalTitle
- bsClass="modal-title"
- componentClass="h4"
- >
- <FormattedMessage
- defaultMessage="New Channel"
- id="channel_modal.modalTitle"
- values={Object {}}
- />
- </ModalTitle>
- </ModalHeader>
- <form
- className="form-horizontal"
- role="form"
- >
- <ModalBody
- bsClass="modal-body"
- componentClass="div"
- >
- <div>
- <div
- className="modal-intro"
- >
- <FormattedMessage
- defaultMessage="Create a new private channel with restricted membership. "
- id="channel_modal.privateGroup1"
- values={Object {}}
- />
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Create a public channel"
- id="channel_modal.publicChannel1"
- values={Object {}}
- />
- </a>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="col-sm-3 form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Name"
- id="channel_modal.name"
- values={Object {}}
- />
- </label>
- <div
- className="col-sm-9"
- >
- <input
- autoFocus={true}
- className="form-control"
- id="newPrivateChannelName"
- maxLength={22}
- onChange={[Function]}
- placeholder="E.g.: \\"Bugs\\", \\"Marketing\\", \\"客户支持\\""
- tabIndex="1"
- type="text"
- value="testchannel"
- />
- <p
- className="input__help dark"
- >
- URL: /testchannel (
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Edit"
- id="channel_modal.edit"
- values={Object {}}
- />
- </a>
- )
- </p>
- </div>
- </div>
- <div
- className="form-group"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Purpose"
- id="channel_modal.purpose"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPrivateChannelPurpose"
- maxLength="250"
- onChange={[Function]}
- placeholder="E.g.: \\"A channel to file bugs and improvements\\""
- rows="4"
- tabIndex="2"
- value="some purpose"
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Describe how this channel should be used."
- id="channel_modal.descriptionHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- <div
- className="form-group less"
- >
- <div
- className="col-sm-3"
- >
- <label
- className="form__label control-label"
- >
- <FormattedMessage
- defaultMessage="Header"
- id="channel_modal.header"
- values={Object {}}
- />
- </label>
- <label
- className="form__label light"
- >
- <FormattedMessage
- defaultMessage="(optional)"
- id="channel_modal.optional"
- values={Object {}}
- />
- </label>
- </div>
- <div
- className="col-sm-9"
- >
- <textarea
- className="form-control no-resize"
- id="newPrivateChannelHeader"
- maxLength="1024"
- onChange={[Function]}
- placeholder="E.g.: \\"[Link Title](http://example.com)\\""
- rows="4"
- tabIndex="2"
- value="some header"
- />
- <p
- className="input__help"
- >
- <FormattedMessage
- defaultMessage="Set text that will appear in the header of the channel beside the channel name. For example, include frequently used links by typing [Link Title](http://example.com)."
- id="channel_modal.headerHelp"
- values={Object {}}
- />
- </p>
- </div>
- </div>
- </ModalBody>
- <ModalFooter
- bsClass="modal-footer"
- componentClass="div"
- >
- <button
- className="btn btn-default"
- onClick={[Function]}
- type="button"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="channel_modal.cancel"
- values={Object {}}
- />
- </button>
- <button
- className="btn btn-primary"
- onClick={[Function]}
- tabIndex="3"
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Create New Channel"
- id="channel_modal.createNew"
- values={Object {}}
- />
- </button>
- </ModalFooter>
- </form>
- </Modal>
-</span>
-`;
diff --git a/webapp/tests/components/__snapshots__/reset_status_modal.test.jsx.snap b/webapp/tests/components/__snapshots__/reset_status_modal.test.jsx.snap
deleted file mode 100644
index e27dd0d44..000000000
--- a/webapp/tests/components/__snapshots__/reset_status_modal.test.jsx.snap
+++ /dev/null
@@ -1,54 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/ResetStatusModal should match snapshot 1`] = `
-<ConfirmModal
- cancelButtonText={
- <FormattedMessage
- defaultMessage="No, keep it as \\"{status}\\""
- id="modal.manaul_status.cancel"
- values={
- Object {
- "status": "",
- }
- }
- />
- }
- checkboxText={
- <FormattedMessage
- defaultMessage="Do not ask me again"
- id="modal.manaul_status.ask"
- values={Object {}}
- />
- }
- confirmButtonClass="btn btn-primary"
- confirmButtonText={
- <FormattedMessage
- defaultMessage="Yes, set my status to \\"Online\\""
- id="modal.manaul_status.button"
- values={Object {}}
- />
- }
- message={
- <FormattedMessage
- defaultMessage="Would you like to switch your status to \\"Online\\"?"
- id="modal.manaul_status.message"
- values={Object {}}
- />
- }
- onCancel={[Function]}
- onConfirm={[Function]}
- show={false}
- showCheckbox={true}
- title={
- <FormattedMessage
- defaultMessage="Your status is set to \\"{status}\\""
- id="modal.manaul_status.title"
- values={
- Object {
- "status": "",
- }
- }
- />
- }
-/>
-`;
diff --git a/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap b/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap
deleted file mode 100644
index cfe719ba4..000000000
--- a/webapp/tests/components/__snapshots__/shortcuts_modal.test.jsx.snap
+++ /dev/null
@@ -1,237 +0,0 @@
-// 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/__snapshots__/spinner_button.test.jsx.snap b/webapp/tests/components/__snapshots__/spinner_button.test.jsx.snap
deleted file mode 100644
index e05132ddd..000000000
--- a/webapp/tests/components/__snapshots__/spinner_button.test.jsx.snap
+++ /dev/null
@@ -1,27 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/SpinnerButton should match snapshot with children 1`] = `
-<button
- className="btn btn-primary"
->
- <span
- id="child1"
- />
- <span
- id="child2"
- />
-</button>
-`;
-
-exports[`components/SpinnerButton should match snapshot with required props 1`] = `
-<button
- className="btn btn-primary"
-/>
-`;
-
-exports[`components/SpinnerButton should match snapshot with spinning 1`] = `
-<img
- className="spinner-button__gif"
- src={Object {}}
-/>
-`;
diff --git a/webapp/tests/components/about_build_modal.test.jsx b/webapp/tests/components/about_build_modal.test.jsx
deleted file mode 100644
index c780c1ff9..000000000
--- a/webapp/tests/components/about_build_modal.test.jsx
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-import {mountWithIntl} from 'tests/helpers/intl-test-helper.jsx';
-
-import AboutBuildModal from 'components/about_build_modal.jsx';
-import {Modal} from 'react-bootstrap';
-
-describe('components/AboutBuildModal', () => {
- afterEach(() => {
- global.window.mm_config = null;
- global.window.mm_license = null;
- });
-
- test('should match snapshot for enterprise edition', () => {
- global.window.mm_config = {
- BuildEnterpriseReady: 'true',
- Version: '3.6.0',
- BuildNumber: '3.6.2',
- SQLDriverName: 'Postgres',
- BuildHash: 'abcdef1234567890',
- BuildHashEnterprise: '0123456789abcdef',
- BuildDate: '21 January 2017'
- };
-
- global.window.mm_license = {
- isLicensed: 'true',
- Company: 'Mattermost Inc'
- };
-
- const wrapper = shallow(
- <AboutBuildModal
- show={true}
- onModalDismissed={null}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot for team edition', () => {
- global.window.mm_config = {
- BuildEnterpriseReady: 'false',
- Version: '3.6.0',
- BuildNumber: '3.6.2',
- SQLDriverName: 'Postgres',
- BuildHash: 'abcdef1234567890',
- BuildDate: '21 January 2017'
- };
-
- global.window.mm_license = null;
-
- const wrapper = shallow(
- <AboutBuildModal
- show={true}
- onModalDismissed={null}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should hide the build number if it is the same as the version number', () => {
- global.window.mm_config = {
- BuildEnterpriseReady: 'false',
- Version: '3.6.0',
- BuildNumber: '3.6.0',
- SQLDriverName: 'Postgres',
- BuildHash: 'abcdef1234567890',
- BuildDate: '21 January 2017'
- };
-
- global.window.mm_license = null;
-
- const wrapper = shallow(
- <AboutBuildModal
- show={true}
- onModalDismissed={null}
- />
- );
- expect(wrapper.find('#versionString').text()).toBe(' 3.6.0');
- });
-
- test('should show the build number if it is the different from the version number', () => {
- global.window.mm_config = {
- BuildEnterpriseReady: 'false',
- Version: '3.6.0',
- BuildNumber: '3.6.2',
- SQLDriverName: 'Postgres',
- BuildHash: 'abcdef1234567890',
- BuildDate: '21 January 2017'
- };
-
- global.window.mm_license = null;
-
- const wrapper = shallow(
- <AboutBuildModal
- show={true}
- onModalDismissed={null}
- />
- );
- expect(wrapper.find('#versionString').text()).toBe(' 3.6.0\u00a0 (3.6.2)');
- });
-
- test('should call onModalDismissed callback when the modal is hidden', (done) => {
- global.window.mm_config = {
- BuildEnterpriseReady: 'false',
- Version: '3.6.0',
- BuildNumber: '3.6.2',
- SQLDriverName: 'Postgres',
- BuildHash: 'abcdef1234567890',
- BuildDate: '21 January 2017'
- };
-
- global.window.mm_license = null;
-
- function onHide() {
- done();
- }
-
- const wrapper = mountWithIntl(
- <AboutBuildModal
- show={true}
- onModalDismissed={onHide}
- />
- );
- wrapper.find(Modal).first().props().onHide();
- });
-});
diff --git a/webapp/tests/components/admin_console/__snapshots__/color_setting.test.jsx.snap b/webapp/tests/components/admin_console/__snapshots__/color_setting.test.jsx.snap
deleted file mode 100644
index 7b8c934ce..000000000
--- a/webapp/tests/components/admin_console/__snapshots__/color_setting.test.jsx.snap
+++ /dev/null
@@ -1,95 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/ColorSetting should match snapshot, all 1`] = `
-<Settings
- helpText="helptext"
- inputId="id"
- label="label"
->
- <div
- className="input-group color-picker colorpicker-element"
- >
- <input
- className="form-control"
- disabled={false}
- onChange={[Function]}
- type="text"
- value="#fff"
- />
- <span
- className="input-group-addon picker-id"
- onClick={[Function]}
- >
- <i
- style={
- Object {
- "backgroundColor": "#fff",
- }
- }
- />
- </span>
- </div>
-</Settings>
-`;
-
-exports[`components/ColorSetting should match snapshot, disabled 1`] = `
-<Settings
- inputId="id"
- label="label"
->
- <div
- className="input-group color-picker colorpicker-element"
- >
- <input
- className="form-control"
- disabled={true}
- onChange={[Function]}
- type="text"
- value="#fff"
- />
- <span
- className="input-group-addon picker-id"
- onClick={[Function]}
- >
- <i
- style={
- Object {
- "backgroundColor": "#fff",
- }
- }
- />
- </span>
- </div>
-</Settings>
-`;
-
-exports[`components/ColorSetting should match snapshot, no help text 1`] = `
-<Settings
- inputId="id"
- label="label"
->
- <div
- className="input-group color-picker colorpicker-element"
- >
- <input
- className="form-control"
- disabled={false}
- onChange={[Function]}
- type="text"
- value="#fff"
- />
- <span
- className="input-group-addon picker-id"
- onClick={[Function]}
- >
- <i
- style={
- Object {
- "backgroundColor": "#fff",
- }
- }
- />
- </span>
- </div>
-</Settings>
-`;
diff --git a/webapp/tests/components/admin_console/color_setting.test.jsx b/webapp/tests/components/admin_console/color_setting.test.jsx
deleted file mode 100644
index a1c44a037..000000000
--- a/webapp/tests/components/admin_console/color_setting.test.jsx
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import ColorSetting from 'components/admin_console/color_setting.jsx';
-
-describe('components/ColorSetting', () => {
- test('should match snapshot, all', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- const wrapper = shallow(
- <ColorSetting
- id='id'
- label='label'
- helpText='helptext'
- value='#fff'
- onChange={emptyFunction}
- disabled={false}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, no help text', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- const wrapper = shallow(
- <ColorSetting
- id='id'
- label='label'
- value='#fff'
- onChange={emptyFunction}
- disabled={false}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, disabled', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- const wrapper = shallow(
- <ColorSetting
- id='id'
- label='label'
- value='#fff'
- onChange={emptyFunction}
- disabled={true}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/admin_console/request_button/__snapshots__/request_button.test.jsx.snap b/webapp/tests/components/admin_console/request_button/__snapshots__/request_button.test.jsx.snap
deleted file mode 100644
index 83e372564..000000000
--- a/webapp/tests/components/admin_console/request_button/__snapshots__/request_button.test.jsx.snap
+++ /dev/null
@@ -1,496 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/admin_console/request_button/request_button.jsx should match snapshot 1`] = `
-<div
- className="form-group"
->
- <div
- className="col-sm-offset-4 col-sm-8"
- >
- <div>
- <button
- className="btn btn-default"
- disabled={false}
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- />
- </button>
- </div>
- <div
- className="help-text"
- >
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- />
- </div>
- </div>
-</div>
-`;
-
-exports[`components/admin_console/request_button/request_button.jsx should match snapshot with request error 1`] = `
-<RequestButton
- buttonText={
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- />
- }
- disabled={false}
- errorMessage={
- Object {
- "defaultMessage": "Error Message: {error}",
- "id": "error.message",
- }
- }
- helpText={
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- />
- }
- includeDetailedError={true}
- 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",
- }
- }
- requestAction={[Function]}
- saveNeeded={false}
- showSuccessMessage={true}
- successMessage={
- Object {
- "defaultMessage": "Test Successful",
- "id": "admin.requestButton.requestSuccess",
- }
- }
->
- <div
- className="form-group"
- >
- <div
- className="col-sm-offset-4 col-sm-8"
- >
- <div>
- <button
- className="btn btn-default"
- disabled={false}
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- >
- <span>
- Button Text
- </span>
- </FormattedMessage>
- </button>
- <div>
- <div
- className="alert alert-warning"
- >
- <i
- className="fa fa-warning"
- />
- <FormattedMessage
- defaultMessage="Error Message: {error}"
- id="error.message"
- values={
- Object {
- "error": "__message__ - __detailed_error__",
- }
- }
- >
- <span>
- Error Message: __message__ - __detailed_error__
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
- <div
- className="help-text"
- >
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- >
- <span>
- Help Text
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
-</RequestButton>
-`;
-
-exports[`components/admin_console/request_button/request_button.jsx should match snapshot with request error 2`] = `
-<RequestButton
- buttonText={
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- />
- }
- disabled={false}
- errorMessage={
- Object {
- "defaultMessage": "Error Message: {error}",
- "id": "error.message",
- }
- }
- helpText={
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- />
- }
- includeDetailedError={false}
- 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",
- }
- }
- requestAction={[Function]}
- saveNeeded={false}
- showSuccessMessage={true}
- successMessage={
- Object {
- "defaultMessage": "Test Successful",
- "id": "admin.requestButton.requestSuccess",
- }
- }
->
- <div
- className="form-group"
- >
- <div
- className="col-sm-offset-4 col-sm-8"
- >
- <div>
- <button
- className="btn btn-default"
- disabled={false}
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- >
- <span>
- Button Text
- </span>
- </FormattedMessage>
- </button>
- <div>
- <div
- className="alert alert-warning"
- >
- <i
- className="fa fa-warning"
- />
- <FormattedMessage
- defaultMessage="Error Message: {error}"
- id="error.message"
- values={
- Object {
- "error": "__message__",
- }
- }
- >
- <span>
- Error Message: __message__
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
- <div
- className="help-text"
- >
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- >
- <span>
- Help Text
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
-</RequestButton>
-`;
-
-exports[`components/admin_console/request_button/request_button.jsx should match snapshot with successMessage 1`] = `
-<RequestButton
- buttonText={
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- />
- }
- disabled={false}
- errorMessage={
- Object {
- "defaultMessage": "Test Failure: {error}",
- "id": "admin.requestButton.requestFailure",
- }
- }
- helpText={
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- />
- }
- includeDetailedError={false}
- 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",
- }
- }
- requestAction={[Function]}
- saveNeeded={false}
- showSuccessMessage={true}
- successMessage={
- Object {
- "defaultMessage": "Success Message",
- "id": "success.message",
- }
- }
->
- <div
- className="form-group"
- >
- <div
- className="col-sm-offset-4 col-sm-8"
- >
- <div>
- <button
- className="btn btn-default"
- disabled={false}
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- >
- <span>
- Button Text
- </span>
- </FormattedMessage>
- </button>
- <div>
- <div
- className="alert alert-success"
- >
- <i
- className="fa fa-success"
- />
- <FormattedMessage
- defaultMessage="Success Message"
- id="success.message"
- values={Object {}}
- >
- <span>
- Success Message
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
- <div
- className="help-text"
- >
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- >
- <span>
- Help Text
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
-</RequestButton>
-`;
-
-exports[`components/admin_console/request_button/request_button.jsx should match snapshot with successMessage 2`] = `
-<RequestButton
- buttonText={
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- />
- }
- disabled={false}
- errorMessage={
- Object {
- "defaultMessage": "Test Failure: {error}",
- "id": "admin.requestButton.requestFailure",
- }
- }
- helpText={
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- />
- }
- includeDetailedError={false}
- 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",
- }
- }
- requestAction={[Function]}
- saveNeeded={false}
- showSuccessMessage={false}
- successMessage={
- Object {
- "defaultMessage": "Success Message",
- "id": "success.message",
- }
- }
->
- <div
- className="form-group"
- >
- <div
- className="col-sm-offset-4 col-sm-8"
- >
- <div>
- <button
- className="btn btn-default"
- disabled={false}
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Button Text"
- id="test"
- values={Object {}}
- >
- <span>
- Button Text
- </span>
- </FormattedMessage>
- </button>
- </div>
- <div
- className="help-text"
- >
- <FormattedMessage
- defaultMessage="Help Text"
- id="test"
- values={Object {}}
- >
- <span>
- Help Text
- </span>
- </FormattedMessage>
- </div>
- </div>
- </div>
-</RequestButton>
-`;
diff --git a/webapp/tests/components/admin_console/request_button/request_button.test.jsx b/webapp/tests/components/admin_console/request_button/request_button.test.jsx
deleted file mode 100644
index 3b3f4b40b..000000000
--- a/webapp/tests/components/admin_console/request_button/request_button.test.jsx
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {FormattedMessage} from 'react-intl';
-
-import {shallow} from 'enzyme';
-import {mountWithIntl} from 'tests/helpers/intl-test-helper.jsx';
-
-import RequestButton from 'components/admin_console/request_button/request_button.jsx';
-
-describe('components/admin_console/request_button/request_button.jsx', () => {
- test('should match snapshot', () => {
- const emptyFunction = jest.fn();
-
- const wrapper = shallow(
- <RequestButton
- requestAction={emptyFunction}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should call saveConfig and request actions when saveNeeded is true', () => {
- const requestActionSuccess = jest.fn((success) => success());
- const saveConfigActionSuccess = jest.fn((success) => success());
-
- const wrapper = mountWithIntl(
- <RequestButton
- requestAction={requestActionSuccess}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- saveNeeded={false}
- saveConfigAction={saveConfigActionSuccess}
- />
- );
-
- wrapper.find('button').first().simulate('click');
-
- expect(requestActionSuccess.mock.calls.length).toBe(1);
- expect(saveConfigActionSuccess.mock.calls.length).toBe(0);
- });
-
- test('should call only request action when saveNeeded is false', () => {
- const requestActionSuccess = jest.fn((success) => success());
- const saveConfigActionSuccess = jest.fn((success) => success());
-
- const wrapper = mountWithIntl(
- <RequestButton
- requestAction={requestActionSuccess}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- saveNeeded={true}
- saveConfigAction={saveConfigActionSuccess}
- />
- );
-
- wrapper.find('button').first().simulate('click');
-
- expect(requestActionSuccess.mock.calls.length).toBe(1);
- expect(saveConfigActionSuccess.mock.calls.length).toBe(1);
- });
-
- test('should match snapshot with successMessage', () => {
- const requestActionSuccess = jest.fn((success) => success());
-
- // Success & showSuccessMessage=true
- const wrapper1 = mountWithIntl(
- <RequestButton
- requestAction={requestActionSuccess}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- showSuccessMessage={true}
- successMessage={{
- id: 'success.message',
- defaultMessage: 'Success Message'
- }}
- />
- );
-
- wrapper1.find('button').first().simulate('click');
- expect(wrapper1).toMatchSnapshot();
-
- // Success & showSuccessMessage=false
- const wrapper2 = mountWithIntl(
- <RequestButton
- requestAction={requestActionSuccess}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- showSuccessMessage={false}
- successMessage={{
- id: 'success.message',
- defaultMessage: 'Success Message'
- }}
- />
- );
-
- wrapper2.find('button').first().simulate('click');
-
- expect(wrapper2).toMatchSnapshot();
- });
-
- test('should match snapshot with request error', () => {
- const requestActionFailure = jest.fn((success, error) => error({
- message: '__message__',
- detailed_error: '__detailed_error__'
- }));
-
- // Error & includeDetailedError=true
- const wrapper1 = mountWithIntl(
- <RequestButton
- requestAction={requestActionFailure}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- includeDetailedError={true}
- errorMessage={{
- id: 'error.message',
- defaultMessage: 'Error Message: {error}'
- }}
- />
- );
-
- wrapper1.find('button').first().simulate('click');
- expect(wrapper1).toMatchSnapshot();
-
- // Error & includeDetailedError=false
- const wrapper2 = mountWithIntl(
- <RequestButton
- requestAction={requestActionFailure}
- helpText={
- <FormattedMessage
- id='test'
- defaultMessage='Help Text'
- />
- }
- buttonText={
- <FormattedMessage
- id='test'
- defaultMessage='Button Text'
- />
- }
- errorMessage={{
- id: 'error.message',
- defaultMessage: 'Error Message: {error}'
- }}
- />
- );
-
- wrapper2.find('button').first().simulate('click');
-
- expect(wrapper2).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/backstage/components/__snapshots__/backstage_header.test.jsx.snap b/webapp/tests/components/backstage/components/__snapshots__/backstage_header.test.jsx.snap
deleted file mode 100644
index 7a0ae9e0c..000000000
--- a/webapp/tests/components/backstage/components/__snapshots__/backstage_header.test.jsx.snap
+++ /dev/null
@@ -1,31 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/backstage/components/BackstageHeader should match snapshot with children 1`] = `
-<div
- className="backstage-header"
->
- <h1>
- <div>
- Child 1
- </div>
- <span
- className="backstage-header__divider"
- >
- <i
- className="fa fa-angle-right"
- />
- </span>
- <div>
- Child 2
- </div>
- </h1>
-</div>
-`;
-
-exports[`components/backstage/components/BackstageHeader should match snapshot without children 1`] = `
-<div
- className="backstage-header"
->
- <h1 />
-</div>
-`;
diff --git a/webapp/tests/components/backstage/components/backstage_header.test.jsx b/webapp/tests/components/backstage/components/backstage_header.test.jsx
deleted file mode 100644
index f6da444d9..000000000
--- a/webapp/tests/components/backstage/components/backstage_header.test.jsx
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import BackstageHeader from 'components/backstage/components/backstage_header.jsx';
-
-describe('components/backstage/components/BackstageHeader', () => {
- test('should match snapshot without children', () => {
- const wrapper = shallow(
- <BackstageHeader/>
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot with children', () => {
- const wrapper = shallow(
- <BackstageHeader>
- <div>{'Child 1'}</div>
- <div>{'Child 2'}</div>
- </BackstageHeader>
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/integrations/__snapshots__/add_command.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/add_command.test.jsx.snap
deleted file mode 100644
index 99e5d7ad8..000000000
--- a/webapp/tests/components/integrations/__snapshots__/add_command.test.jsx.snap
+++ /dev/null
@@ -1,396 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/AddCommand should match snapshot 1`] = `
-<div
- className="backstage-content row"
->
- <BackstageHeader>
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/commands"
- >
- <FormattedMessage
- defaultMessage="Slash Commands"
- id="installed_command.header"
- values={Object {}}
- />
- </Link>
- <FormattedMessage
- defaultMessage="Add"
- id="integrations.add"
- values={Object {}}
- />
- </BackstageHeader>
- <div
- className="backstage-form"
- >
- <form
- className="form-horizontal"
- onSubmit={[Function]}
- >
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="displayName"
- >
- <FormattedMessage
- defaultMessage="Display Name"
- id="add_command.displayName"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="displayName"
- maxLength="64"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Display name for your slash command made of up to 64 characters."
- id="add_command.displayName.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="description"
- >
- <FormattedMessage
- defaultMessage="Description"
- id="add_command.description"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="description"
- maxLength="128"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Description for your incoming webhook."
- id="add_command.description.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="trigger"
- >
- <FormattedMessage
- defaultMessage="Command Trigger Word"
- id="add_command.trigger"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="trigger"
- maxLength={128}
- onChange={[Function]}
- placeholder="Command trigger e.g. \\"hello\\" not including the slash"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Trigger word must be unique, and cannot begin with a slash or contain any spaces."
- id="add_command.trigger.help"
- values={Object {}}
- />
- </div>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Examples: client, employee, patient, weather"
- id="add_command.trigger.helpExamples"
- values={Object {}}
- />
- </div>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Reserved: {link}"
- id="add_command.trigger.helpReserved"
- values={
- Object {
- "link": <a
- href="https://docs.mattermost.com/help/messaging/executing-commands.html#built-in-commands"
- rel="noopener noreferrer"
- target="_blank"
- >
- <FormattedMessage
- defaultMessage="see list of built-in slash commands"
- id="add_command.trigger.helpReservedLinkText"
- values={Object {}}
- />
- </a>,
- }
- }
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="url"
- >
- <FormattedMessage
- defaultMessage="Request URL"
- id="add_command.url"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="url"
- maxLength="1024"
- onChange={[Function]}
- placeholder="Must start with http:// or https://"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The callback URL to receive the HTTP POST or GET event request when the slash command is run."
- id="add_command.url.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="method"
- >
- <FormattedMessage
- defaultMessage="Request Method"
- id="add_command.method"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <select
- className="form-control"
- id="method"
- onChange={[Function]}
- value="P"
- >
- <option
- value="P"
- >
- POST
- </option>
- <option
- value="G"
- >
- GET
- </option>
- </select>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The type of command request issued to the Request URL."
- id="add_command.method.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="username"
- >
- <FormattedMessage
- defaultMessage="Response Username"
- id="add_command.username"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="username"
- maxLength="64"
- onChange={[Function]}
- placeholder="Username"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Choose a username override for responses for this slash command. Usernames can consist of up to 22 characters consisting of lowercase letters, numbers and they symbols \\"-\\", \\"_\\", and \\".\\" ."
- id="add_command.username.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="iconUrl"
- >
- <FormattedMessage
- defaultMessage="Response Icon"
- id="add_command.iconUrl"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="iconUrl"
- maxLength="1024"
- onChange={[Function]}
- placeholder="https://www.example.com/myicon.png"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Choose a profile picture override for the post responses to this slash command. Enter the URL of a .png or .jpg file at least 128 pixels by 128 pixels."
- id="add_command.iconUrl.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="autocomplete"
- >
- <FormattedMessage
- defaultMessage="Autocomplete"
- id="add_command.autocomplete"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8 checkbox"
- >
- <input
- checked={false}
- id="autocomplete"
- onChange={[Function]}
- type="checkbox"
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Show slash command in autocomplete list."
- id="add_command.autocomplete.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="backstage-form__footer"
- >
- <FormError
- error={null}
- errors={
- Array [
- "",
- null,
- ]
- }
- type="backstage"
- />
- <Link
- className="btn btn-sm"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/commands"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="add_command.cancel"
- values={Object {}}
- />
- </Link>
- <SpinnerButton
- className="btn btn-primary"
- onClick={[Function]}
- spinning={false}
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Save"
- id="add_command.save"
- values={Object {}}
- />
- </SpinnerButton>
- </div>
- </form>
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/add_incoming_hook.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/add_incoming_hook.test.jsx.snap
deleted file mode 100644
index ce34d81bc..000000000
--- a/webapp/tests/components/integrations/__snapshots__/add_incoming_hook.test.jsx.snap
+++ /dev/null
@@ -1,26 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/AddIncomingWebhook should match snapshot 1`] = `
-<AbstractIncomingWebhook
- action={[Function]}
- footer={
- Object {
- "defaultMessage": "Save",
- "id": "add_incoming_webhook.save",
- }
- }
- header={
- Object {
- "defaultMessage": "Add",
- "id": "integrations.add",
- }
- }
- serverError=""
- team={
- Object {
- "id": "testteamid",
- "name": "test",
- }
- }
-/>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/add_oauth_app.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/add_oauth_app.test.jsx.snap
deleted file mode 100644
index eceffcddb..000000000
--- a/webapp/tests/components/integrations/__snapshots__/add_oauth_app.test.jsx.snap
+++ /dev/null
@@ -1,613 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/AddOAuthApp should match snapshot 1`] = `
-<div
- className="backstage-content"
->
- <BackstageHeader>
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/oauth2-apps"
- >
- <FormattedMessage
- defaultMessage="Installed OAuth2 Apps"
- id="installed_oauth_apps.header"
- values={Object {}}
- />
- </Link>
- <FormattedMessage
- defaultMessage="Add"
- id="add_oauth_app.header"
- values={Object {}}
- />
- </BackstageHeader>
- <div
- className="backstage-form"
- >
- <form
- className="form-horizontal"
- >
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="is_trusted"
- >
- <FormattedMessage
- defaultMessage="Is Trusted"
- id="installed_oauth_apps.trusted"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <label
- className="radio-inline"
- >
- <input
- checked={false}
- name="is_trusted"
- onChange={[Function]}
- type="radio"
- value="true"
- />
- <FormattedMessage
- defaultMessage="Yes"
- id="installed_oauth_apps.trusted.yes"
- values={Object {}}
- />
- </label>
- <label
- className="radio-inline"
- >
- <input
- checked={true}
- name="is_trusted"
- onChange={[Function]}
- type="radio"
- value="false"
- />
- <FormattedMessage
- defaultMessage="No"
- id="installed_oauth_apps.trusted.no"
- values={Object {}}
- />
- </label>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="When true, the OAuth 2.0 application is considered trusted by the Mattermost server and doesn't require the user to accept authorization. When false, an additional window will appear, asking the user to accept or deny the authorization."
- id="add_oauth_app.trusted.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="name"
- >
- <FormattedMessage
- defaultMessage="Display Name"
- id="installed_oauth_apps.name"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="name"
- maxLength="64"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Display name for your OAuth 2.0 application made of up to 64 characters."
- id="add_oauth_app.name.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="description"
- >
- <FormattedMessage
- defaultMessage="Description"
- id="installed_oauth_apps.description"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="description"
- maxLength="512"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Description for your OAuth 2.0 application."
- id="add_oauth_app.description.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="homepage"
- >
- <FormattedMessage
- defaultMessage="Homepage"
- id="installed_oauth_apps.homepage"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="homepage"
- maxLength="256"
- onChange={[Function]}
- type="url"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The URL for the homepage of the OAuth 2.0 application. Make sure you use HTTP or HTTPS in your URL depending on your server configuration."
- id="add_oauth_app.homepage.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="icon_url"
- >
- <FormattedMessage
- defaultMessage="Icon URL"
- id="installed_oauth_apps.iconUrl"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="icon_url"
- maxLength="512"
- onChange={[Function]}
- type="url"
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The URL for the homepage of the OAuth 2.0 application. Make sure you use HTTP or HTTPS in your URL depending on your server configuration."
- id="add_oauth_app.icon.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="callbackUrls"
- >
- <FormattedMessage
- defaultMessage="Callback URLs (One Per Line)"
- id="installed_oauth_apps.callbackUrls"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <textarea
- className="form-control"
- id="callbackUrls"
- maxLength="1024"
- onChange={[Function]}
- rows="3"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The redirect URIs to which the service will redirect users after accepting or denying authorization of your application, and which will handle authorization codes or access tokens. Must be a valid URL and start with http:// or https://."
- id="add_oauth_app.callbackUrls.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="backstage-form__footer"
- >
- <FormError
- error={null}
- errors={
- Array [
- "",
- null,
- ]
- }
- type="backstage"
- />
- <Link
- className="btn btn-sm"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/oauth2-apps"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="installed_oauth_apps.cancel"
- values={Object {}}
- />
- </Link>
- <SpinnerButton
- className="btn btn-primary"
- onClick={[Function]}
- spinning={false}
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Save"
- id="installed_oauth_apps.save"
- values={Object {}}
- />
- </SpinnerButton>
- </div>
- </form>
- </div>
-</div>
-`;
-
-exports[`components/integrations/AddOAuthApp should match snapshot, displays client error 1`] = `
-<div
- className="backstage-content"
->
- <BackstageHeader>
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/oauth2-apps"
- >
- <FormattedMessage
- defaultMessage="Installed OAuth2 Apps"
- id="installed_oauth_apps.header"
- values={Object {}}
- />
- </Link>
- <FormattedMessage
- defaultMessage="Add"
- id="add_oauth_app.header"
- values={Object {}}
- />
- </BackstageHeader>
- <div
- className="backstage-form"
- >
- <form
- className="form-horizontal"
- >
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="is_trusted"
- >
- <FormattedMessage
- defaultMessage="Is Trusted"
- id="installed_oauth_apps.trusted"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <label
- className="radio-inline"
- >
- <input
- checked={false}
- name="is_trusted"
- onChange={[Function]}
- type="radio"
- value="true"
- />
- <FormattedMessage
- defaultMessage="Yes"
- id="installed_oauth_apps.trusted.yes"
- values={Object {}}
- />
- </label>
- <label
- className="radio-inline"
- >
- <input
- checked={true}
- name="is_trusted"
- onChange={[Function]}
- type="radio"
- value="false"
- />
- <FormattedMessage
- defaultMessage="No"
- id="installed_oauth_apps.trusted.no"
- values={Object {}}
- />
- </label>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="When true, the OAuth 2.0 application is considered trusted by the Mattermost server and doesn't require the user to accept authorization. When false, an additional window will appear, asking the user to accept or deny the authorization."
- id="add_oauth_app.trusted.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="name"
- >
- <FormattedMessage
- defaultMessage="Display Name"
- id="installed_oauth_apps.name"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="name"
- maxLength="64"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Display name for your OAuth 2.0 application made of up to 64 characters."
- id="add_oauth_app.name.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="description"
- >
- <FormattedMessage
- defaultMessage="Description"
- id="installed_oauth_apps.description"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="description"
- maxLength="512"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Description for your OAuth 2.0 application."
- id="add_oauth_app.description.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="homepage"
- >
- <FormattedMessage
- defaultMessage="Homepage"
- id="installed_oauth_apps.homepage"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="homepage"
- maxLength="256"
- onChange={[Function]}
- type="url"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The URL for the homepage of the OAuth 2.0 application. Make sure you use HTTP or HTTPS in your URL depending on your server configuration."
- id="add_oauth_app.homepage.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="icon_url"
- >
- <FormattedMessage
- defaultMessage="Icon URL"
- id="installed_oauth_apps.iconUrl"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="icon_url"
- maxLength="512"
- onChange={[Function]}
- type="url"
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The URL for the homepage of the OAuth 2.0 application. Make sure you use HTTP or HTTPS in your URL depending on your server configuration."
- id="add_oauth_app.icon.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="callbackUrls"
- >
- <FormattedMessage
- defaultMessage="Callback URLs (One Per Line)"
- id="installed_oauth_apps.callbackUrls"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <textarea
- className="form-control"
- id="callbackUrls"
- maxLength="1024"
- onChange={[Function]}
- rows="3"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The redirect URIs to which the service will redirect users after accepting or denying authorization of your application, and which will handle authorization codes or access tokens. Must be a valid URL and start with http:// or https://."
- id="add_oauth_app.callbackUrls.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="backstage-form__footer"
- >
- <FormError
- error={null}
- errors={
- Array [
- "",
- <FormattedMessage
- defaultMessage="Name for the OAuth 2.0 application is required."
- id="add_oauth_app.nameRequired"
- values={Object {}}
- />,
- ]
- }
- type="backstage"
- />
- <Link
- className="btn btn-sm"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/oauth2-apps"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="installed_oauth_apps.cancel"
- values={Object {}}
- />
- </Link>
- <SpinnerButton
- className="btn btn-primary"
- onClick={[Function]}
- spinning={false}
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Save"
- id="installed_oauth_apps.save"
- values={Object {}}
- />
- </SpinnerButton>
- </div>
- </form>
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/add_outgoing_hook.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/add_outgoing_hook.test.jsx.snap
deleted file mode 100644
index a55f5db5e..000000000
--- a/webapp/tests/components/integrations/__snapshots__/add_outgoing_hook.test.jsx.snap
+++ /dev/null
@@ -1,27 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/AddOutgoingWebhook should match snapshot 1`] = `
-<AbstractOutgoingWebhook
- action={[Function]}
- footer={
- Object {
- "defaultMessage": "Save",
- "id": "add_outgoing_webhook.save",
- }
- }
- header={
- Object {
- "defaultMessage": "Add",
- "id": "integrations.add",
- }
- }
- renderExtra=""
- serverError=""
- team={
- Object {
- "id": "testteamid",
- "name": "test",
- }
- }
-/>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/edit_command.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/edit_command.test.jsx.snap
deleted file mode 100644
index dd4fcffef..000000000
--- a/webapp/tests/components/integrations/__snapshots__/edit_command.test.jsx.snap
+++ /dev/null
@@ -1,424 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/EditCommand should match snapshot 1`] = `
-<div
- className="backstage-content row"
->
- <BackstageHeader>
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/commands"
- >
- <FormattedMessage
- defaultMessage="Slash Commands"
- id="installed_command.header"
- values={Object {}}
- />
- </Link>
- <FormattedMessage
- defaultMessage="Edit"
- id="integrations.edit"
- values={Object {}}
- />
- </BackstageHeader>
- <div
- className="backstage-form"
- >
- <form
- className="form-horizontal"
- onSubmit={[Function]}
- >
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="displayName"
- >
- <FormattedMessage
- defaultMessage="Display Name"
- id="add_command.displayName"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="displayName"
- maxLength="64"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Display name for your slash command made of up to 64 characters."
- id="add_command.displayName.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="description"
- >
- <FormattedMessage
- defaultMessage="Description"
- id="add_command.description"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="description"
- maxLength="128"
- onChange={[Function]}
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Description for your incoming webhook."
- id="add_command.description.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="trigger"
- >
- <FormattedMessage
- defaultMessage="Command Trigger Word"
- id="add_command.trigger"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="trigger"
- maxLength={128}
- onChange={[Function]}
- placeholder="Command trigger e.g. \\"hello\\" not including the slash"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Trigger word must be unique, and cannot begin with a slash or contain any spaces."
- id="add_command.trigger.help"
- values={Object {}}
- />
- </div>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Examples: client, employee, patient, weather"
- id="add_command.trigger.helpExamples"
- values={Object {}}
- />
- </div>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="Reserved: {link}"
- id="add_command.trigger.helpReserved"
- values={
- Object {
- "link": <a
- href="https://docs.mattermost.com/help/messaging/executing-commands.html#built-in-commands"
- rel="noopener noreferrer"
- target="_blank"
- >
- <FormattedMessage
- defaultMessage="see list of built-in slash commands"
- id="add_command.trigger.helpReservedLinkText"
- values={Object {}}
- />
- </a>,
- }
- }
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="url"
- >
- <FormattedMessage
- defaultMessage="Request URL"
- id="add_command.url"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="url"
- maxLength="1024"
- onChange={[Function]}
- placeholder="Must start with http:// or https://"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The callback URL to receive the HTTP POST or GET event request when the slash command is run."
- id="add_command.url.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="method"
- >
- <FormattedMessage
- defaultMessage="Request Method"
- id="add_command.method"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <select
- className="form-control"
- id="method"
- onChange={[Function]}
- value="P"
- >
- <option
- value="P"
- >
- POST
- </option>
- <option
- value="G"
- >
- GET
- </option>
- </select>
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="The type of command request issued to the Request URL."
- id="add_command.method.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="username"
- >
- <FormattedMessage
- defaultMessage="Response Username"
- id="add_command.username"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="username"
- maxLength="64"
- onChange={[Function]}
- placeholder="Username"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Choose a username override for responses for this slash command. Usernames can consist of up to 22 characters consisting of lowercase letters, numbers and they symbols \\"-\\", \\"_\\", and \\".\\" ."
- id="add_command.username.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="iconUrl"
- >
- <FormattedMessage
- defaultMessage="Response Icon"
- id="add_command.iconUrl"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8"
- >
- <input
- className="form-control"
- id="iconUrl"
- maxLength="1024"
- onChange={[Function]}
- placeholder="https://www.example.com/myicon.png"
- type="text"
- value=""
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Choose a profile picture override for the post responses to this slash command. Enter the URL of a .png or .jpg file at least 128 pixels by 128 pixels."
- id="add_command.iconUrl.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="form-group"
- >
- <label
- className="control-label col-sm-4"
- htmlFor="autocomplete"
- >
- <FormattedMessage
- defaultMessage="Autocomplete"
- id="add_command.autocomplete"
- values={Object {}}
- />
- </label>
- <div
- className="col-md-5 col-sm-8 checkbox"
- >
- <input
- checked={false}
- id="autocomplete"
- onChange={[Function]}
- type="checkbox"
- />
- <div
- className="form__help"
- >
- <FormattedMessage
- defaultMessage="(Optional) Show slash command in autocomplete list."
- id="add_command.autocomplete.help"
- values={Object {}}
- />
- </div>
- </div>
- </div>
- <div
- className="backstage-form__footer"
- >
- <FormError
- error={null}
- errors={
- Array [
- "",
- null,
- ]
- }
- type="backstage"
- />
- <Link
- className="btn btn-sm"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/commands"
- >
- <FormattedMessage
- defaultMessage="Cancel"
- id="add_command.cancel"
- values={Object {}}
- />
- </Link>
- <SpinnerButton
- className="btn btn-primary"
- disabled={true}
- onClick={[Function]}
- spinning={false}
- type="submit"
- >
- <FormattedMessage
- defaultMessage="Update"
- id="edit_command.save"
- values={Object {}}
- />
- </SpinnerButton>
- <ConfirmModal
- confirmButtonClass="btn btn-primary"
- confirmButtonText={
- <FormattedMessage
- defaultMessage="Update"
- id="update_command.update"
- values={Object {}}
- />
- }
- message={
- <FormattedMessage
- defaultMessage="Your changes may break the existing slash command. Are you sure you would like to update it?"
- id="update_command.question"
- values={Object {}}
- />
- }
- onCancel={[Function]}
- onConfirm={[Function]}
- show={false}
- title={
- <FormattedMessage
- defaultMessage="Edit Slash Command"
- id="update_command.confirm"
- values={Object {}}
- />
- }
- />
- </div>
- </form>
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/edit_incoming_hook.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/edit_incoming_hook.test.jsx.snap
deleted file mode 100644
index ed392dcbd..000000000
--- a/webapp/tests/components/integrations/__snapshots__/edit_incoming_hook.test.jsx.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/EditIncomingWebhook should match snapshot 1`] = `
-<LoadingScreen
- position="relative"
-/>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/edit_outgoing_hook.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/edit_outgoing_hook.test.jsx.snap
deleted file mode 100644
index d7656b08f..000000000
--- a/webapp/tests/components/integrations/__snapshots__/edit_outgoing_hook.test.jsx.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/EditOutgoingWebhook should match snapshot 1`] = `
-<LoadingScreen
- position="relative"
-/>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/installed_command.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/installed_command.test.jsx.snap
deleted file mode 100644
index 910b35e25..000000000
--- a/webapp/tests/components/integrations/__snapshots__/installed_command.test.jsx.snap
+++ /dev/null
@@ -1,103 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/InstalledCommand should filter out command 1`] = `null`;
-
-exports[`components/integrations/InstalledCommand should match snapshot 1`] = `
-<div
- className="backstage-list__item"
->
- <div
- className="item-details"
- >
- <div
- className="item-details__row"
- >
- <span
- className="item-details__name"
- >
- test
- </span>
- <span
- className="item-details__trigger"
- >
- - /trigger test
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__description"
- >
- test
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__token"
- >
- <FormattedMessage
- defaultMessage="Token: {token}"
- id="installed_integrations.token"
- values={
- Object {
- "token": "testToken",
- }
- }
- />
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__creation"
- >
- <FormattedMessage
- defaultMessage="Created by {creator} on {createAt, date, full}"
- id="installed_integrations.creation"
- values={
- Object {
- "createAt": "1499722850203",
- "creator": "test",
- }
- }
- />
- </span>
- </div>
- </div>
- <div
- className="item-actions"
- >
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Regenerate Token"
- id="installed_integrations.regenToken"
- values={Object {}}
- />
- </a>
- -
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/test/integrations/commands/edit?id=r5tpgt4iepf45jt768jz84djic"
- >
- <FormattedMessage
- defaultMessage="Edit"
- id="installed_integrations.edit"
- values={Object {}}
- />
- </Link>
- -
- <DeleteIntegration
- messageId="installed_commands.delete.confirm"
- onDelete={[Function]}
- />
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/installed_oauth_app.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/installed_oauth_app.test.jsx.snap
deleted file mode 100644
index f4e8fb464..000000000
--- a/webapp/tests/components/integrations/__snapshots__/installed_oauth_app.test.jsx.snap
+++ /dev/null
@@ -1,155 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/InstalledOAuthApp should filter out OAuthApp 1`] = `null`;
-
-exports[`components/integrations/InstalledOAuthApp should match snapshot 1`] = `
-<div
- className="backstage-list__item"
->
- <div
- className="integration__icon integration-list__icon"
- >
- <img
- src="https://test.com/icon"
- />
- </div>
- <div
- className="item-details"
- >
- <div
- className="item-details__row"
- >
- <span
- className="item-details__name"
- >
- testApp
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__description"
- >
- testing
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__url"
- >
- <FormattedHTMLMessage
- defaultMessage="Is Trusted: <strong>{isTrusted}</strong>"
- id="installed_oauth_apps.is_trusted"
- values={
- Object {
- "isTrusted": "Yes",
- }
- }
- />
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__token"
- >
- <FormattedHTMLMessage
- defaultMessage="Client ID: <strong>{clientId}</strong>"
- id="installed_integrations.client_id"
- values={
- Object {
- "clientId": "facxd9wpzpbpfp8pad78xj75pr",
- }
- }
- />
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__token"
- >
- <FormattedHTMLMessage
- defaultMessage="Client Secret: <strong>{clientSecret}</strong>"
- id="installed_integrations.client_secret"
- values={
- Object {
- "clientSecret": "***************",
- }
- }
- />
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__url"
- >
- <FormattedMessage
- defaultMessage="Callback URLs: {urls}"
- id="installed_integrations.callback_urls"
- values={
- Object {
- "urls": "https://test.com/callback, https://test.com/callback2",
- }
- }
- />
- </span>
- </div>
- <div
- className="item-details__row"
- >
- <span
- className="item-details__creation"
- >
- <FormattedMessage
- defaultMessage="Created by {creator} on {createAt, date, full}"
- id="installed_integrations.creation"
- values={
- Object {
- "createAt": 1501365458934,
- "creator": "",
- }
- }
- />
- </span>
- </div>
- </div>
- <div
- className="item-actions"
- >
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Show Secret"
- id="installed_integrations.showSecret"
- values={Object {}}
- />
- </a>
- -
- <a
- href="#"
- onClick={[Function]}
- >
- <FormattedMessage
- defaultMessage="Regenerate Secret"
- id="installed_integrations.regenSecret"
- values={Object {}}
- />
- </a>
- -
- <DeleteIntegration
- messageId="installed_oauth_apps.delete.confirm"
- onDelete={[Function]}
- />
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/integrations/__snapshots__/installed_oauth_apps.test.jsx.snap b/webapp/tests/components/integrations/__snapshots__/installed_oauth_apps.test.jsx.snap
deleted file mode 100644
index c6ef12112..000000000
--- a/webapp/tests/components/integrations/__snapshots__/installed_oauth_apps.test.jsx.snap
+++ /dev/null
@@ -1,100 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/integrations/InstalledOAuthApps should match snapshot 1`] = `
-<BackstageList
- addLink="/test/integrations/oauth2-apps/add"
- addText="Add OAuth 2.0 Application"
- emptyText={
- <FormattedMessage
- defaultMessage="No OAuth 2.0 Applications found"
- id="installed_oauth_apps.empty"
- values={Object {}}
- />
- }
- header={
- <FormattedMessage
- defaultMessage="OAuth 2.0 Applications"
- id="installed_oauth_apps.header"
- values={Object {}}
- />
- }
- helpText={
- <FormattedMessage
- defaultMessage="Create {oauthApplications} to securely integrate bots and third-party apps with Mattermost. Visit the {appDirectory} to find available self-hosted apps."
- id="installed_oauth_apps.help"
- values={
- Object {
- "appDirectory": <a
- href="https://about.mattermost.com/default-app-directory/"
- rel="noopener noreferrer"
- target="_blank"
- >
- <FormattedMessage
- defaultMessage="App Directory"
- id="installed_oauth_apps.help.appDirectory"
- values={Object {}}
- />
- </a>,
- "oauthApplications": <a
- href="https://docs.mattermost.com/developer/oauth-2-0-applications.html"
- rel="noopener noreferrer"
- target="_blank"
- >
- <FormattedMessage
- defaultMessage="OAuth 2.0 applications"
- id="installed_oauth_apps.help.oauthApplications"
- values={Object {}}
- />
- </a>,
- }
- }
- />
- }
- loading={true}
- searchPlaceholder="Search OAuth 2.0 Applications"
->
- <InstalledOAuthApp
- oauthApp={
- Object {
- "callback_urls": Array [
- "https://test.com/callback",
- ],
- "client_secret": "88cxd9wpzpbpfp8pad78xj75pr",
- "create_at": 1501365458934,
- "creator_id": "88oybd1dwfdoxpkpw1h5kpbyco",
- "description": "testing",
- "homepage": "https://test.com",
- "icon_url": "https://test.com/icon",
- "id": "facxd9wpzpbpfp8pad78xj75pr",
- "is_trusted": false,
- "name": "firstApp",
- "update_at": 1501365458934,
- }
- }
- onDelete={[Function]}
- onRegenerateSecret={[Function]}
- />
- <InstalledOAuthApp
- oauthApp={
- Object {
- "callback_urls": Array [
- "https://test2.com/callback",
- "https://test2.com/callback2",
- ],
- "client_secret": "decxd9wpzpbpfp8pad78xj75pr",
- "create_at": 1501365459984,
- "creator_id": "88oybd2dwfdoxpkpw1h5kpbyco",
- "description": "testing2",
- "homepage": "https://test2.com",
- "icon_url": "https://test2.com/icon",
- "id": "fzcxd9wpzpbpfp8pad78xj75pr",
- "is_trusted": true,
- "name": "secondApp",
- "update_at": 1501365479988,
- }
- }
- onDelete={[Function]}
- onRegenerateSecret={[Function]}
- />
-</BackstageList>
-`;
diff --git a/webapp/tests/components/integrations/add_command.test.jsx b/webapp/tests/components/integrations/add_command.test.jsx
deleted file mode 100644
index cf8a31e07..000000000
--- a/webapp/tests/components/integrations/add_command.test.jsx
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import * as Utils from 'utils/utils.jsx';
-import AddCommand from 'components/integrations/components/add_command/add_command.jsx';
-
-describe('components/integrations/AddCommand', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
- const teamId = Utils.generateId();
-
- const wrapper = shallow(
- <AddCommand
- team={{
- id: teamId,
- name: 'test'
- }}
- addCommandRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{addCommand: emptyFunction}}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/integrations/add_incoming_hook.test.jsx b/webapp/tests/components/integrations/add_incoming_hook.test.jsx
deleted file mode 100644
index ae5a46cb2..000000000
--- a/webapp/tests/components/integrations/add_incoming_hook.test.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
- import React from 'react';
- import {shallow} from 'enzyme';
-
- import AddIncomingWebhook from 'components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx';
-
- describe('components/integrations/AddIncomingWebhook', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
- const teamId = 'testteamid';
-
- const wrapper = shallow(
- <AddIncomingWebhook
- team={{
- id: teamId,
- name: 'test'
- }}
- createIncomingHookRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{createIncomingHook: emptyFunction}}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
- });
diff --git a/webapp/tests/components/integrations/add_oauth_app.test.jsx b/webapp/tests/components/integrations/add_oauth_app.test.jsx
deleted file mode 100644
index 11e743ff5..000000000
--- a/webapp/tests/components/integrations/add_oauth_app.test.jsx
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import AddOAuthApp from 'components/integrations/components/add_oauth_app/add_oauth_app.jsx';
-
-describe('components/integrations/AddOAuthApp', () => {
- const emptyFunction = jest.fn();
- const team = {
- id: 'dbcxd9wpzpbpfp8pad78xj12pr',
- name: 'test'
- };
-
- test('should match snapshot', () => {
- const wrapper = shallow(
- <AddOAuthApp
- team={team}
- addOAuthAppRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{addOAuthApp: emptyFunction}}
- />
- );
-
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, displays client error', () => {
- const wrapper = shallow(
- <AddOAuthApp
- team={team}
- addOAuthAppRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{addOAuthApp: emptyFunction}}
- />
- );
-
- wrapper.find('.btn-primary').simulate('click', {preventDefault() {
- return jest.fn();
- }});
-
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should call addOAuthApp function', () => {
- const addOAuthApp = jest.genMockFunction().mockImplementation(
- () => {
- return new Promise((resolve) => {
- process.nextTick(() => resolve());
- });
- }
- );
-
- const wrapper = shallow(
- <AddOAuthApp
- team={team}
- addOAuthAppRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{addOAuthApp}}
- />
- );
-
- wrapper.find('#name').simulate('change', {target: {value: 'name'}});
- wrapper.find('#description').simulate('change', {target: {value: 'description'}});
- wrapper.find('#homepage').simulate('change', {target: {value: 'http://test.com'}});
- wrapper.find('#callbackUrls').simulate('change', {target: {value: 'http://callback.com'}});
-
- wrapper.find('.btn-primary').simulate('click', {preventDefault() {
- return jest.fn();
- }});
-
- expect(addOAuthApp).toBeCalled();
- });
-}); \ No newline at end of file
diff --git a/webapp/tests/components/integrations/add_outgoing_hook.test.jsx b/webapp/tests/components/integrations/add_outgoing_hook.test.jsx
deleted file mode 100644
index 0c92a7c83..000000000
--- a/webapp/tests/components/integrations/add_outgoing_hook.test.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import AddOutgoingWebhook from 'components/integrations/components/add_outgoing_webhook/add_outgoing_webhook.jsx';
-
-describe('components/integrations/AddOutgoingWebhook', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
- const teamId = 'testteamid';
-
- const wrapper = shallow(
- <AddOutgoingWebhook
- team={{
- id: teamId,
- name: 'test'
- }}
- createOutgoingHookRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{createOutgoingHook: emptyFunction}}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/integrations/edit_command.test.jsx b/webapp/tests/components/integrations/edit_command.test.jsx
deleted file mode 100644
index 6b919cb86..000000000
--- a/webapp/tests/components/integrations/edit_command.test.jsx
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import EditCommand from 'components/integrations/components/edit_command/edit_command.jsx';
-
-describe('components/integrations/EditCommand', () => {
- test('should match snapshot', () => {
- const emptyFunction = jest.fn();
- const id = 'r5tpgt4iepf45jt768jz84djic';
- global.window.mm_config = {};
- global.window.mm_config.EnableCommands = 'true';
-
- const wrapper = shallow(
- <EditCommand
- team={{
- id,
- name: 'test'
- }}
- commandId={id}
- commands={[]}
- editCommandRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{
- getCustomTeamCommands: emptyFunction,
- editCommand: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-}); \ No newline at end of file
diff --git a/webapp/tests/components/integrations/edit_incoming_hook.test.jsx b/webapp/tests/components/integrations/edit_incoming_hook.test.jsx
deleted file mode 100644
index cb7544314..000000000
--- a/webapp/tests/components/integrations/edit_incoming_hook.test.jsx
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
- import React from 'react';
- import {shallow} from 'enzyme';
-
- import EditIncomingWebhook from 'components/integrations/components/edit_incoming_webhook/edit_incoming_webhook.jsx';
-
- describe('components/integrations/EditIncomingWebhook', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
- const teamId = 'testteamid';
-
- const wrapper = shallow(
- <EditIncomingWebhook
- team={{
- id: teamId,
- name: 'test'
- }}
- hookId={'somehookid'}
- updateIncomingHookRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{updateIncomingHook: emptyFunction, getIncomingHook: emptyFunction}}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
- });
diff --git a/webapp/tests/components/integrations/edit_outgoing_hook.test.jsx b/webapp/tests/components/integrations/edit_outgoing_hook.test.jsx
deleted file mode 100644
index c2a5020a6..000000000
--- a/webapp/tests/components/integrations/edit_outgoing_hook.test.jsx
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import EditOutgoingWebhook from 'components/integrations/components/edit_outgoing_webhook/edit_outgoing_webhook.jsx';
-
-describe('components/integrations/EditOutgoingWebhook', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
- const teamId = 'testteamid';
-
- const wrapper = shallow(
- <EditOutgoingWebhook
- team={{
- id: teamId,
- name: 'test'
- }}
- hookId={'somehookid'}
- updateOutgoingHookRequest={{
- status: 'not_started',
- error: null
- }}
- actions={{updateOutgoingHook: emptyFunction, getOutgoingHook: emptyFunction}}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
-
diff --git a/webapp/tests/components/integrations/installed_command.test.jsx b/webapp/tests/components/integrations/installed_command.test.jsx
deleted file mode 100644
index b38d04754..000000000
--- a/webapp/tests/components/integrations/installed_command.test.jsx
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import InstalledCommand from 'components/integrations/components/installed_command.jsx';
-
-describe('components/integrations/InstalledCommand', () => {
- const emptyFunction = jest.fn();
- const command = {
- id: 'r5tpgt4iepf45jt768jz84djic',
- display_name: 'test',
- description: 'test',
- trigger: 'trigger',
- auto_complete: 'test',
- auto_complete_hint: 'test',
- token: 'testToken',
- create_at: '1499722850203'
- };
-
- test('should match snapshot', () => {
- const wrapper = shallow(
- <InstalledCommand
- team={{
- name: 'test'
- }}
- command={command}
- onRegenToken={emptyFunction}
- onDelete={emptyFunction}
- filter={'trigger'}
- creator={{
- username: 'test'
- }}
- canChange={true}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should call onRegenToken function', () => {
- const onRegenToken = jest.fn();
- const wrapper = shallow(
- <InstalledCommand
- team={{
- name: 'test'
- }}
- command={command}
- onRegenToken={onRegenToken}
- onDelete={emptyFunction}
- filter={''}
- creator={{
- username: 'test'
- }}
- canChange={true}
- />
- );
- wrapper.find('div.item-actions a').first().simulate('click', {preventDefault() {
- return jest.fn();
- }});
-
- expect(onRegenToken).toBeCalled();
- });
-
- test('should filter out command', () => {
- const wrapper = shallow(
- <InstalledCommand
- team={{
- name: 'test'
- }}
- command={command}
- onRegenToken={emptyFunction}
- onDelete={emptyFunction}
- filter={'filter'}
- creator={{
- username: 'test'
- }}
- canChange={true}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/integrations/installed_oauth_app.test.jsx b/webapp/tests/components/integrations/installed_oauth_app.test.jsx
deleted file mode 100644
index ff27a5768..000000000
--- a/webapp/tests/components/integrations/installed_oauth_app.test.jsx
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import InstalledOAuthApp from 'components/integrations/components/installed_oauth_app.jsx';
-
-describe('components/integrations/InstalledOAuthApp', () => {
- const emptyFunction = jest.fn();
- const app = {
- id: 'facxd9wpzpbpfp8pad78xj75pr',
- name: 'testApp',
- client_secret: '88cxd9wpzpbpfp8pad78xj75pr',
- create_at: 1501365458934,
- creator_id: '88oybd1dwfdoxpkpw1h5kpbyco',
- description: 'testing',
- homepage: 'https://test.com',
- icon_url: 'https://test.com/icon',
- is_trusted: true,
- update_at: 1501365458934,
- callback_urls: ['https://test.com/callback', 'https://test.com/callback2']
- };
-
- test('should match snapshot', () => {
- const wrapper = shallow(
- <InstalledOAuthApp
- oauthApp={app}
- onRegenerateSecret={emptyFunction}
- onDelete={emptyFunction}
- filter={''}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should call onRegenerateSecret function', () => {
- const onRegenerateSecret = jest.genMockFunction().mockImplementation(
- () => {
- return new Promise((resolve) => {
- process.nextTick(() => resolve());
- });
- }
- );
-
- const wrapper = shallow(
- <InstalledOAuthApp
- oauthApp={app}
- onRegenerateSecret={onRegenerateSecret}
- onDelete={emptyFunction}
- filter={''}
- />
- );
- wrapper.find('div.item-actions a').at(1).simulate('click', {preventDefault() {
- return jest.fn();
- }});
- expect(onRegenerateSecret).toBeCalled();
- });
-
- test('should filter out OAuthApp', () => {
- const wrapper = shallow(
- <InstalledOAuthApp
- oauthApp={app}
- onRegenerateSecret={emptyFunction}
- onDelete={emptyFunction}
- filter={'filter'}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-}); \ No newline at end of file
diff --git a/webapp/tests/components/integrations/installed_oauth_apps.test.jsx b/webapp/tests/components/integrations/installed_oauth_apps.test.jsx
deleted file mode 100644
index 2e5ccad7a..000000000
--- a/webapp/tests/components/integrations/installed_oauth_apps.test.jsx
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import InstalledOAuthApps from 'components/integrations/components/installed_oauth_apps/installed_oauth_apps.jsx';
-
-describe('components/integrations/InstalledOAuthApps', () => {
- test('should match snapshot', () => {
- const emptyFunction = jest.fn();
- const oauthApps = {
- facxd9wpzpbpfp8pad78xj75pr: {
- id: 'facxd9wpzpbpfp8pad78xj75pr',
- name: 'firstApp',
- client_secret: '88cxd9wpzpbpfp8pad78xj75pr',
- create_at: 1501365458934,
- creator_id: '88oybd1dwfdoxpkpw1h5kpbyco',
- description: 'testing',
- homepage: 'https://test.com',
- icon_url: 'https://test.com/icon',
- is_trusted: false,
- update_at: 1501365458934,
- callback_urls: ['https://test.com/callback']
- },
- fzcxd9wpzpbpfp8pad78xj75pr: {
- id: 'fzcxd9wpzpbpfp8pad78xj75pr',
- name: 'secondApp',
- client_secret: 'decxd9wpzpbpfp8pad78xj75pr',
- create_at: 1501365459984,
- creator_id: '88oybd2dwfdoxpkpw1h5kpbyco',
- description: 'testing2',
- homepage: 'https://test2.com',
- icon_url: 'https://test2.com/icon',
- is_trusted: true,
- update_at: 1501365479988,
- callback_urls: ['https://test2.com/callback', 'https://test2.com/callback2']
- }
- };
- global.window.mm_config = {EnableOAuthServiceProvider: 'true'};
-
- const wrapper = shallow(
- <InstalledOAuthApps
- team={{name: 'test'}}
- oauthApps={oauthApps}
- isSystemAdmin={true}
- actions={{
- getOAuthApps: emptyFunction,
- regenOAuthAppSecret: emptyFunction,
- deleteOAuthApp: emptyFunction
- }}
- />
- );
- expect(wrapper.find('InstalledOAuthApp').length).toBe(2);
- expect(wrapper).toMatchSnapshot();
- });
-}); \ No newline at end of file
diff --git a/webapp/tests/components/new_channel_modal.test.jsx b/webapp/tests/components/new_channel_modal.test.jsx
deleted file mode 100644
index 358a839a3..000000000
--- a/webapp/tests/components/new_channel_modal.test.jsx
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import Constants from 'utils/constants.jsx';
-
-import NewChannelModal from 'components/new_channel_modal/new_channel_modal.jsx';
-
-describe('components/NewChannelModal', () => {
- afterEach(() => {
- global.window.mm_config = null;
- global.window.mm_license = null;
- });
-
- test('should match snapshot, modal not showing', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_license = {};
- global.window.mm_license.IsLicensed = 'false';
-
- const wrapper = shallow(
- <NewChannelModal
- show={true}
- channelType={Constants.OPEN_CHANNEL}
- channelData={{name: 'testchannel', displayName: 'testchannel', header: '', purpose: ''}}
- onSubmitChannel={emptyFunction}
- onModalDismissed={emptyFunction}
- onTypeSwitched={emptyFunction}
- onChangeURLPressed={emptyFunction}
- onDataChanged={emptyFunction}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, modal showing', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_license = {};
- global.window.mm_license.IsLicensed = 'false';
-
- const wrapper = shallow(
- <NewChannelModal
- show={true}
- channelType={Constants.OPEN_CHANNEL}
- channelData={{name: 'testchannel', displayName: 'testchannel', header: '', purpose: ''}}
- onSubmitChannel={emptyFunction}
- onModalDismissed={emptyFunction}
- onTypeSwitched={emptyFunction}
- onChangeURLPressed={emptyFunction}
- onDataChanged={emptyFunction}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, private channel filled in header and purpose', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_license = {};
- global.window.mm_license.IsLicensed = 'false';
-
- const wrapper = shallow(
- <NewChannelModal
- show={true}
- channelType={Constants.PRIVATE_CHANNEL}
- channelData={{name: 'testchannel', displayName: 'testchannel', header: 'some header', purpose: 'some purpose'}}
- onSubmitChannel={emptyFunction}
- onModalDismissed={emptyFunction}
- onTypeSwitched={emptyFunction}
- onChangeURLPressed={emptyFunction}
- onDataChanged={emptyFunction}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/post_view/post_info/__snapshots__/post_info.test.jsx.snap b/webapp/tests/components/post_view/post_info/__snapshots__/post_info.test.jsx.snap
deleted file mode 100644
index d58df052d..000000000
--- a/webapp/tests/components/post_view/post_info/__snapshots__/post_info.test.jsx.snap
+++ /dev/null
@@ -1,515 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`components/post_view/PostInfo should match snapshot 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={false}
- isFlagged={false}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__reply"
- >
- <Connect(DotMenu)
- commentCount={0}
- handleCommentClick={[Function]}
- handleDropdownOpened={[Function]}
- idCount={-1}
- idPrefix="center"
- isFlagged={false}
- post={
- Object {
- "channel_id": "g6139tbospd18cmxroesdk3kkc",
- "create_at": 1502715365009,
- "delete_at": 0,
- "edit_at": 1502715372443,
- "hashtags": "",
- "id": "e584uzbwwpny9kengqayx5ayzw",
- "is_pinned": false,
- "message": "post message",
- "original_id": "",
- "parent_id": "",
- "pending_post_id": "",
- "props": Object {},
- "root_id": "",
- "type": "",
- "update_at": 1502715372443,
- "user_id": "b4pfxi8sn78y8yq7phzxxfor7h",
- }
- }
- />
- <span>
- <EmojiPickerOverlay
- container={[Function]}
- onEmojiClick={[Function]}
- onHide={[Function]}
- rightOffset={7}
- show={false}
- spaceRequiredAbove={422}
- spaceRequiredBelow={436}
- target={[Function]}
- />
- <a
- className="reacticon__container"
- href="#"
- onClick={[Function]}
- >
- <span
- className="icon icon--emoji"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <g stroke='none' stroke-width='1' fill='inherit' fill-rule='evenodd'> <g transform='translate(-1071.000000, -954.000000)' fill='inherit'> <g transform='translate(25.000000, 937.000000)'> <g transform='translate(1046.000000, 17.000000)'> <path d='M7.5,0.0852272727 C3.405,0.0852272727 0.0852272727,3.405 0.0852272727,7.5 C0.0852272727,11.595 3.405,14.9147727 7.5,14.9147727 C11.595,14.9147727 14.9147727,11.595 14.9147727,7.5 C14.9147727,3.405 11.595,0.0852272727 7.5,0.0852272727 Z M7.5,14.0663436 C3.87926951,14.0663436 0.933656417,11.1207305 0.933656417,7.5 C0.933656417,3.87926951 3.87926951,0.933656417 7.5,0.933656417 C11.1207305,0.933656417 14.0663436,3.87926951 14.0663436,7.5 C14.0663436,11.1207305 11.1207305,14.0663436 7.5,14.0663436 Z'></path> <path d='M11.7732955,8.95397727 C12.0119318,8.90488636 12.2159659,9.11778409 12.1684091,9.35676136 C11.8063636,11.1790909 9.85346591,12.5710227 7.49846591,12.5710227 C5.15096591,12.5710227 3.20284091,11.1877841 2.83193182,9.37397727 C2.78181818,9.129375 2.99267045,8.911875 3.23744318,8.96198864 C4.85369318,9.29232955 10.1786932,9.28142045 11.7732955,8.95397727 Z'></path> <ellipse cx='4.94318182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> <ellipse cx='10.0568182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> </g> </g> </g> </g> </svg>",
- }
- }
- />
- </a>
- </span>
- <CommentIcon
- commentCount={0}
- handleCommentClick={[Function]}
- id="g6139tbospd18cmxroesdk3kkc_e584uzbwwpny9kengqayx5ayzw"
- idCount={-1}
- idPrefix="commentIcon"
- searchStyle=""
- />
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, compact display 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={false}
- isFlagged={false}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__reply"
- >
- <Connect(DotMenu)
- commentCount={0}
- handleCommentClick={[Function]}
- handleDropdownOpened={[Function]}
- idCount={-1}
- idPrefix="center"
- isFlagged={false}
- post={
- Object {
- "channel_id": "g6139tbospd18cmxroesdk3kkc",
- "create_at": 1502715365009,
- "delete_at": 0,
- "edit_at": 1502715372443,
- "hashtags": "",
- "id": "e584uzbwwpny9kengqayx5ayzw",
- "is_pinned": false,
- "message": "post message",
- "original_id": "",
- "parent_id": "",
- "pending_post_id": "",
- "props": Object {},
- "root_id": "",
- "type": "",
- "update_at": 1502715372443,
- "user_id": "b4pfxi8sn78y8yq7phzxxfor7h",
- }
- }
- />
- <span>
- <EmojiPickerOverlay
- container={[Function]}
- onEmojiClick={[Function]}
- onHide={[Function]}
- rightOffset={7}
- show={false}
- spaceRequiredAbove={422}
- spaceRequiredBelow={436}
- target={[Function]}
- />
- <a
- className="reacticon__container"
- href="#"
- onClick={[Function]}
- >
- <span
- className="icon icon--emoji"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <g stroke='none' stroke-width='1' fill='inherit' fill-rule='evenodd'> <g transform='translate(-1071.000000, -954.000000)' fill='inherit'> <g transform='translate(25.000000, 937.000000)'> <g transform='translate(1046.000000, 17.000000)'> <path d='M7.5,0.0852272727 C3.405,0.0852272727 0.0852272727,3.405 0.0852272727,7.5 C0.0852272727,11.595 3.405,14.9147727 7.5,14.9147727 C11.595,14.9147727 14.9147727,11.595 14.9147727,7.5 C14.9147727,3.405 11.595,0.0852272727 7.5,0.0852272727 Z M7.5,14.0663436 C3.87926951,14.0663436 0.933656417,11.1207305 0.933656417,7.5 C0.933656417,3.87926951 3.87926951,0.933656417 7.5,0.933656417 C11.1207305,0.933656417 14.0663436,3.87926951 14.0663436,7.5 C14.0663436,11.1207305 11.1207305,14.0663436 7.5,14.0663436 Z'></path> <path d='M11.7732955,8.95397727 C12.0119318,8.90488636 12.2159659,9.11778409 12.1684091,9.35676136 C11.8063636,11.1790909 9.85346591,12.5710227 7.49846591,12.5710227 C5.15096591,12.5710227 3.20284091,11.1877841 2.83193182,9.37397727 C2.78181818,9.129375 2.99267045,8.911875 3.23744318,8.96198864 C4.85369318,9.29232955 10.1786932,9.28142045 11.7732955,8.95397727 Z'></path> <ellipse cx='4.94318182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> <ellipse cx='10.0568182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> </g> </g> </g> </g> </svg>",
- }
- }
- />
- </a>
- </span>
- <CommentIcon
- commentCount={0}
- handleCommentClick={[Function]}
- id="g6139tbospd18cmxroesdk3kkc_e584uzbwwpny9kengqayx5ayzw"
- idCount={-1}
- idPrefix="commentIcon"
- searchStyle=""
- />
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, ephemeral deleted post 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={false}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={true}
- isFlagged={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__remove"
- >
- <a
- className="post__remove theme"
- href="#"
- onClick={[Function]}
- type="button"
- >
- ×
- </a>
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, ephemeral post 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={false}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={true}
- isFlagged={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- <span
- className="post__visibility"
- >
- <FormattedMessage
- defaultMessage="(Only visible to you)"
- id="post_info.message.visible"
- values={Object {}}
- />
- </span>
- </div>
- <div
- className="col col__remove"
- >
- <a
- className="post__remove theme"
- href="#"
- onClick={[Function]}
- type="button"
- >
- ×
- </a>
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, flagged post 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={false}
- isFlagged={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__reply"
- >
- <Connect(DotMenu)
- commentCount={0}
- handleCommentClick={[Function]}
- handleDropdownOpened={[Function]}
- idCount={-1}
- idPrefix="center"
- isFlagged={true}
- post={
- Object {
- "channel_id": "g6139tbospd18cmxroesdk3kkc",
- "create_at": 1502715365009,
- "delete_at": 0,
- "edit_at": 1502715372443,
- "hashtags": "",
- "id": "e584uzbwwpny9kengqayx5ayzw",
- "is_pinned": false,
- "message": "post message",
- "original_id": "",
- "parent_id": "",
- "pending_post_id": "",
- "props": Object {},
- "root_id": "",
- "type": "",
- "update_at": 1502715372443,
- "user_id": "b4pfxi8sn78y8yq7phzxxfor7h",
- }
- }
- />
- <span>
- <EmojiPickerOverlay
- container={[Function]}
- onEmojiClick={[Function]}
- onHide={[Function]}
- rightOffset={7}
- show={false}
- spaceRequiredAbove={422}
- spaceRequiredBelow={436}
- target={[Function]}
- />
- <a
- className="reacticon__container"
- href="#"
- onClick={[Function]}
- >
- <span
- className="icon icon--emoji"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <g stroke='none' stroke-width='1' fill='inherit' fill-rule='evenodd'> <g transform='translate(-1071.000000, -954.000000)' fill='inherit'> <g transform='translate(25.000000, 937.000000)'> <g transform='translate(1046.000000, 17.000000)'> <path d='M7.5,0.0852272727 C3.405,0.0852272727 0.0852272727,3.405 0.0852272727,7.5 C0.0852272727,11.595 3.405,14.9147727 7.5,14.9147727 C11.595,14.9147727 14.9147727,11.595 14.9147727,7.5 C14.9147727,3.405 11.595,0.0852272727 7.5,0.0852272727 Z M7.5,14.0663436 C3.87926951,14.0663436 0.933656417,11.1207305 0.933656417,7.5 C0.933656417,3.87926951 3.87926951,0.933656417 7.5,0.933656417 C11.1207305,0.933656417 14.0663436,3.87926951 14.0663436,7.5 C14.0663436,11.1207305 11.1207305,14.0663436 7.5,14.0663436 Z'></path> <path d='M11.7732955,8.95397727 C12.0119318,8.90488636 12.2159659,9.11778409 12.1684091,9.35676136 C11.8063636,11.1790909 9.85346591,12.5710227 7.49846591,12.5710227 C5.15096591,12.5710227 3.20284091,11.1877841 2.83193182,9.37397727 C2.78181818,9.129375 2.99267045,8.911875 3.23744318,8.96198864 C4.85369318,9.29232955 10.1786932,9.28142045 11.7732955,8.95397727 Z'></path> <ellipse cx='4.94318182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> <ellipse cx='10.0568182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> </g> </g> </g> </g> </svg>",
- }
- }
- />
- </a>
- </span>
- <CommentIcon
- commentCount={0}
- handleCommentClick={[Function]}
- id="g6139tbospd18cmxroesdk3kkc_e584uzbwwpny9kengqayx5ayzw"
- idCount={-1}
- idPrefix="commentIcon"
- searchStyle=""
- />
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, military time 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={true}
- />
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={false}
- isFlagged={false}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__reply"
- >
- <Connect(DotMenu)
- commentCount={0}
- handleCommentClick={[Function]}
- handleDropdownOpened={[Function]}
- idCount={-1}
- idPrefix="center"
- isFlagged={false}
- post={
- Object {
- "channel_id": "g6139tbospd18cmxroesdk3kkc",
- "create_at": 1502715365009,
- "delete_at": 0,
- "edit_at": 1502715372443,
- "hashtags": "",
- "id": "e584uzbwwpny9kengqayx5ayzw",
- "is_pinned": false,
- "message": "post message",
- "original_id": "",
- "parent_id": "",
- "pending_post_id": "",
- "props": Object {},
- "root_id": "",
- "type": "",
- "update_at": 1502715372443,
- "user_id": "b4pfxi8sn78y8yq7phzxxfor7h",
- }
- }
- />
- <CommentIcon
- commentCount={0}
- handleCommentClick={[Function]}
- id="g6139tbospd18cmxroesdk3kkc_e584uzbwwpny9kengqayx5ayzw"
- idCount={-1}
- idPrefix="commentIcon"
- searchStyle=""
- />
- </div>
-</div>
-`;
-
-exports[`components/post_view/PostInfo should match snapshot, pinned post 1`] = `
-<div
- className="post__header--info"
->
- <div
- className="col"
- >
- <PostTime
- eventTime={1502715365009}
- isPermalink={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- useMilitaryTime={false}
- />
- <span
- className="post__pinned-badge"
- >
- <FormattedMessage
- defaultMessage="Pinned"
- id="post_info.pinned"
- values={Object {}}
- />
- </span>
- <PostFlagIcon
- idCount={-1}
- idPrefix="centerPostFlag"
- isEphemeral={false}
- isFlagged={true}
- postId="e584uzbwwpny9kengqayx5ayzw"
- />
- </div>
- <div
- className="col col__reply"
- >
- <Connect(DotMenu)
- commentCount={0}
- handleCommentClick={[Function]}
- handleDropdownOpened={[Function]}
- idCount={-1}
- idPrefix="center"
- isFlagged={true}
- post={
- Object {
- "channel_id": "g6139tbospd18cmxroesdk3kkc",
- "create_at": 1502715365009,
- "delete_at": 0,
- "edit_at": 1502715372443,
- "hashtags": "",
- "id": "e584uzbwwpny9kengqayx5ayzw",
- "is_pinned": true,
- "message": "post message",
- "original_id": "",
- "parent_id": "",
- "pending_post_id": "",
- "props": Object {},
- "root_id": "",
- "type": "",
- "update_at": 1502715372443,
- "user_id": "b4pfxi8sn78y8yq7phzxxfor7h",
- }
- }
- />
- <span>
- <EmojiPickerOverlay
- container={[Function]}
- onEmojiClick={[Function]}
- onHide={[Function]}
- rightOffset={7}
- show={false}
- spaceRequiredAbove={422}
- spaceRequiredBelow={436}
- target={[Function]}
- />
- <a
- className="reacticon__container"
- href="#"
- onClick={[Function]}
- >
- <span
- className="icon icon--emoji"
- dangerouslySetInnerHTML={
- Object {
- "__html": "<svg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <g stroke='none' stroke-width='1' fill='inherit' fill-rule='evenodd'> <g transform='translate(-1071.000000, -954.000000)' fill='inherit'> <g transform='translate(25.000000, 937.000000)'> <g transform='translate(1046.000000, 17.000000)'> <path d='M7.5,0.0852272727 C3.405,0.0852272727 0.0852272727,3.405 0.0852272727,7.5 C0.0852272727,11.595 3.405,14.9147727 7.5,14.9147727 C11.595,14.9147727 14.9147727,11.595 14.9147727,7.5 C14.9147727,3.405 11.595,0.0852272727 7.5,0.0852272727 Z M7.5,14.0663436 C3.87926951,14.0663436 0.933656417,11.1207305 0.933656417,7.5 C0.933656417,3.87926951 3.87926951,0.933656417 7.5,0.933656417 C11.1207305,0.933656417 14.0663436,3.87926951 14.0663436,7.5 C14.0663436,11.1207305 11.1207305,14.0663436 7.5,14.0663436 Z'></path> <path d='M11.7732955,8.95397727 C12.0119318,8.90488636 12.2159659,9.11778409 12.1684091,9.35676136 C11.8063636,11.1790909 9.85346591,12.5710227 7.49846591,12.5710227 C5.15096591,12.5710227 3.20284091,11.1877841 2.83193182,9.37397727 C2.78181818,9.129375 2.99267045,8.911875 3.23744318,8.96198864 C4.85369318,9.29232955 10.1786932,9.28142045 11.7732955,8.95397727 Z'></path> <ellipse cx='4.94318182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> <ellipse cx='10.0568182' cy='5.50431818' rx='1' ry='1.06534091'></ellipse> </g> </g> </g> </g> </svg>",
- }
- }
- />
- </a>
- </span>
- <CommentIcon
- commentCount={0}
- handleCommentClick={[Function]}
- id="g6139tbospd18cmxroesdk3kkc_e584uzbwwpny9kengqayx5ayzw"
- idCount={-1}
- idPrefix="commentIcon"
- searchStyle=""
- />
- </div>
-</div>
-`;
diff --git a/webapp/tests/components/post_view/post_info/post_info.test.jsx b/webapp/tests/components/post_view/post_info/post_info.test.jsx
deleted file mode 100644
index d254226eb..000000000
--- a/webapp/tests/components/post_view/post_info/post_info.test.jsx
+++ /dev/null
@@ -1,225 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import Constants from 'utils/constants.jsx';
-import PostInfo from 'components/post_view/post_info/post_info.jsx';
-import {Posts} from 'mattermost-redux/constants';
-
-const post = {
- channel_id: 'g6139tbospd18cmxroesdk3kkc',
- create_at: 1502715365009,
- delete_at: 0,
- edit_at: 1502715372443,
- hashtags: '',
- id: 'e584uzbwwpny9kengqayx5ayzw',
- is_pinned: false,
- message: 'post message',
- original_id: '',
- parent_id: '',
- pending_post_id: '',
- props: {},
- root_id: '',
- type: '',
- update_at: 1502715372443,
- user_id: 'b4pfxi8sn78y8yq7phzxxfor7h'
-};
-
-describe('components/post_view/PostInfo', () => {
- afterEach(() => {
- global.window.mm_config = null;
- global.window.EnableEmojiPicker = null;
- });
-
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={false}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, compact display', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={false}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, military time', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'false';
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={true}
- isFlagged={false}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, flagged post', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={true}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, pinned post', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- post.is_pinned = true;
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={true}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, ephemeral post', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- post.is_pinned = false;
- post.type = Constants.PostTypes.EPHEMERAL;
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={true}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot, ephemeral deleted post', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- global.window.mm_config = {};
- global.window.mm_config.EnableEmojiPicker = 'true';
-
- post.type = Constants.PostTypes.EPHEMERAL;
- post.state = Posts.POST_DELETED;
-
- const wrapper = shallow(
- <PostInfo
- post={post}
- handleCommentClick={emptyFunction}
- handleDropdownOpened={emptyFunction}
- compactDisplay={false}
- lastPostCount={0}
- replyCount={0}
- getPostList={emptyFunction}
- useMilitaryTime={false}
- isFlagged={true}
- actions={{
- removePost: emptyFunction,
- addReaction: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-}); \ No newline at end of file
diff --git a/webapp/tests/components/reset_status_modal.test.jsx b/webapp/tests/components/reset_status_modal.test.jsx
deleted file mode 100644
index 420bb2bfe..000000000
--- a/webapp/tests/components/reset_status_modal.test.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow} from 'enzyme';
-
-import ResetStatusModal from 'components/reset_status_modal/reset_status_modal.jsx';
-
-describe('components/ResetStatusModal', () => {
- test('should match snapshot', () => {
- function emptyFunction() {} //eslint-disable-line no-empty-function
-
- async function fakeAutoReset() { //eslint-disable-line require-await
- return {status: 'away', manual: true, user_id: 'fake'};
- }
-
- const wrapper = shallow(
- <ResetStatusModal
- autoResetPref=''
- actions={{
- autoResetStatus: fakeAutoReset,
- setStatus: emptyFunction,
- savePreferences: emptyFunction
- }}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-});
diff --git a/webapp/tests/components/shortcuts_modal.test.jsx b/webapp/tests/components/shortcuts_modal.test.jsx
deleted file mode 100644
index 04fa51a76..000000000
--- a/webapp/tests/components/shortcuts_modal.test.jsx
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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();
- });
-});
diff --git a/webapp/tests/components/spinner_button.test.jsx b/webapp/tests/components/spinner_button.test.jsx
deleted file mode 100644
index 40a323f44..000000000
--- a/webapp/tests/components/spinner_button.test.jsx
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {shallow, mount} from 'enzyme';
-
-import SpinnerButton from 'components/spinner_button.jsx';
-
-describe('components/SpinnerButton', () => {
- test('should match snapshot with required props', () => {
- const wrapper = shallow(
- <SpinnerButton
- spinning={false}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot with spinning', () => {
- const wrapper = shallow(
- <SpinnerButton
- spinning={true}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should match snapshot with children', () => {
- const wrapper = shallow(
- <SpinnerButton
- spinning={false}
- >
- <span id='child1'/>
- <span id='child2'/>
- </SpinnerButton>
- );
- expect(wrapper).toMatchSnapshot();
- });
-
- test('should handle onClick', (done) => {
- function onClick() {
- done();
- }
-
- const wrapper = mount(
- <SpinnerButton
- spinning={false}
- onClick={onClick}
- />
- );
- wrapper.find('button').first().props().onClick();
- });
-});
diff --git a/webapp/tests/components/suggestion/suggestion_box.test.jsx b/webapp/tests/components/suggestion/suggestion_box.test.jsx
deleted file mode 100644
index 85ca634ad..000000000
--- a/webapp/tests/components/suggestion/suggestion_box.test.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import SuggestionBox from 'components/suggestion/suggestion_box.jsx';
-
-describe('components/SuggestionBox', function() {
- test('findOverlap', () => {
- expect(SuggestionBox.findOverlap('', 'blue')).toBe('');
- expect(SuggestionBox.findOverlap('red', '')).toBe('');
- expect(SuggestionBox.findOverlap('red', 'blue')).toBe('');
- expect(SuggestionBox.findOverlap('red', 'dog')).toBe('d');
- expect(SuggestionBox.findOverlap('red', 'education')).toBe('ed');
- expect(SuggestionBox.findOverlap('red', 'reduce')).toBe('red');
- expect(SuggestionBox.findOverlap('black', 'ack')).toBe('ack');
- });
-});