summaryrefslogtreecommitdiffstats
path: root/webapp/tests/components/integrations
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/tests/components/integrations')
-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
20 files changed, 0 insertions, 2335 deletions
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