diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 21:09:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 21:09:57 +0000 |
commit | bfce95a4c5e9d71ed523f48f3fb901d2b7af60f7 (patch) | |
tree | 6bada22ff3863edec03f928f8edcf19c6e7107f1 /spec/frontend/sidebar/lock | |
parent | 85f7fa54f404f28b0f351c2be0f7a6e9d74fe65f (diff) | |
download | gitlab-ce-bfce95a4c5e9d71ed523f48f3fb901d2b7af60f7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/sidebar/lock')
-rw-r--r-- | spec/frontend/sidebar/lock/__snapshots__/edit_form_spec.js.snap | 79 | ||||
-rw-r--r-- | spec/frontend/sidebar/lock/edit_form_spec.js | 12 |
2 files changed, 84 insertions, 7 deletions
diff --git a/spec/frontend/sidebar/lock/__snapshots__/edit_form_spec.js.snap b/spec/frontend/sidebar/lock/__snapshots__/edit_form_spec.js.snap new file mode 100644 index 00000000000..18d4df297df --- /dev/null +++ b/spec/frontend/sidebar/lock/__snapshots__/edit_form_spec.js.snap @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Edit Form Dropdown In issue page when locked the appropriate warning text is rendered 1`] = ` +<div + class="dropdown-menu sidebar-item-warning-message" + data-testid="warning-text" +> + <p + class="text" + > + <gl-sprintf-stub + message="Unlock this %{issuableDisplayName}? %{strongStart}Everyone%{strongEnd} will be able to comment." + /> + </p> + + <edit-form-buttons-stub + islocked="true" + issuabledisplayname="issue" + /> +</div> +`; + +exports[`Edit Form Dropdown In issue page when unlocked the appropriate warning text is rendered 1`] = ` +<div + class="dropdown-menu sidebar-item-warning-message" + data-testid="warning-text" +> + <p + class="text" + > + <gl-sprintf-stub + message="Lock this %{issuableDisplayName}? Only %{strongStart}project members%{strongEnd} will be able to comment." + /> + </p> + + <edit-form-buttons-stub + issuabledisplayname="issue" + /> +</div> +`; + +exports[`Edit Form Dropdown In merge request page when locked the appropriate warning text is rendered 1`] = ` +<div + class="dropdown-menu sidebar-item-warning-message" + data-testid="warning-text" +> + <p + class="text" + > + <gl-sprintf-stub + message="Unlock this %{issuableDisplayName}? %{strongStart}Everyone%{strongEnd} will be able to comment." + /> + </p> + + <edit-form-buttons-stub + islocked="true" + issuabledisplayname="merge request" + /> +</div> +`; + +exports[`Edit Form Dropdown In merge request page when unlocked the appropriate warning text is rendered 1`] = ` +<div + class="dropdown-menu sidebar-item-warning-message" + data-testid="warning-text" +> + <p + class="text" + > + <gl-sprintf-stub + message="Lock this %{issuableDisplayName}? Only %{strongStart}project members%{strongEnd} will be able to comment." + /> + </p> + + <edit-form-buttons-stub + issuabledisplayname="merge request" + /> +</div> +`; diff --git a/spec/frontend/sidebar/lock/edit_form_spec.js b/spec/frontend/sidebar/lock/edit_form_spec.js index 6a86ab14d90..b1c3bfe3ef5 100644 --- a/spec/frontend/sidebar/lock/edit_form_spec.js +++ b/spec/frontend/sidebar/lock/edit_form_spec.js @@ -38,18 +38,16 @@ describe('Edit Form Dropdown', () => { }); describe.each` - isLocked | lockStatusText | lockAction | warningText - ${false} | ${'unlocked'} | ${'Lock'} | ${'Only project members will be able to comment.'} - ${true} | ${'locked'} | ${'Unlock'} | ${'Everyone will be able to comment.'} - `('when $lockStatusText', ({ isLocked, lockAction, warningText }) => { + isLocked | lockStatusText + ${false} | ${'unlocked'} + ${true} | ${'locked'} + `('when $lockStatusText', ({ isLocked }) => { beforeEach(() => { createComponent({ props: { isLocked } }); }); it(`the appropriate warning text is rendered`, () => { - expect(findWarningText().text()).toContain( - `${lockAction} this ${issuableDisplayName}? ${warningText}`, - ); + expect(findWarningText().element).toMatchSnapshot(); }); }); }); |