Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issuable')
-rw-r--r--spec/frontend/issuable/components/issuable_by_email_spec.js6
-rw-r--r--spec/frontend/issuable/components/issuable_header_warnings_spec.js5
-rw-r--r--spec/frontend/issuable/issuable_form_spec.js10
3 files changed, 13 insertions, 8 deletions
diff --git a/spec/frontend/issuable/components/issuable_by_email_spec.js b/spec/frontend/issuable/components/issuable_by_email_spec.js
index 01abf239e57..b04a6c0b8fd 100644
--- a/spec/frontend/issuable/components/issuable_by_email_spec.js
+++ b/spec/frontend/issuable/components/issuable_by_email_spec.js
@@ -5,7 +5,7 @@ import MockAdapter from 'axios-mock-adapter';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import IssuableByEmail from '~/issuable/components/issuable_by_email.vue';
-import httpStatus from '~/lib/utils/http_status';
+import { HTTP_STATUS_NOT_FOUND, HTTP_STATUS_OK } from '~/lib/utils/http_status';
const initialEmail = 'user@gitlab.com';
@@ -130,7 +130,7 @@ describe('IssuableByEmail', () => {
});
it('should update the email when the request succeeds', async () => {
- mockAxios.onPut(resetPath).reply(httpStatus.OK, { new_address: 'foo@bar.com' });
+ mockAxios.onPut(resetPath).reply(HTTP_STATUS_OK, { new_address: 'foo@bar.com' });
wrapper = createComponent({
issuableType: 'issue',
@@ -144,7 +144,7 @@ describe('IssuableByEmail', () => {
});
it('should show a toast message when the request fails', async () => {
- mockAxios.onPut(resetPath).reply(httpStatus.NOT_FOUND, {});
+ mockAxios.onPut(resetPath).reply(HTTP_STATUS_NOT_FOUND, {});
wrapper = createComponent({
issuableType: 'issue',
diff --git a/spec/frontend/issuable/components/issuable_header_warnings_spec.js b/spec/frontend/issuable/components/issuable_header_warnings_spec.js
index e3a36dc8820..99aa6778e1e 100644
--- a/spec/frontend/issuable/components/issuable_header_warnings_spec.js
+++ b/spec/frontend/issuable/components/issuable_header_warnings_spec.js
@@ -7,7 +7,7 @@ import createIssueStore from '~/notes/stores';
import IssuableHeaderWarnings from '~/issuable/components/issuable_header_warnings.vue';
const ISSUABLE_TYPE_ISSUE = 'issue';
-const ISSUABLE_TYPE_MR = 'merge request';
+const ISSUABLE_TYPE_MR = 'merge_request';
Vue.use(Vuex);
@@ -57,6 +57,7 @@ describe('IssuableHeaderWarnings', () => {
beforeEach(() => {
store.getters.getNoteableData.confidential = confidentialStatus;
store.getters.getNoteableData.discussion_locked = lockStatus;
+ store.getters.getNoteableData.targetType = issuableType;
createComponent({ store, provide: { hidden: hiddenStatus } });
});
@@ -84,7 +85,7 @@ describe('IssuableHeaderWarnings', () => {
if (hiddenStatus) {
expect(hiddenIcon.attributes('title')).toBe(
- 'This issue is hidden because its author has been banned',
+ `This ${issuableType.replace('_', ' ')} is hidden because its author has been banned`,
);
expect(getBinding(hiddenIcon.element, 'gl-tooltip')).not.toBeUndefined();
}
diff --git a/spec/frontend/issuable/issuable_form_spec.js b/spec/frontend/issuable/issuable_form_spec.js
index 5e67ea42b87..28ec0e22d8b 100644
--- a/spec/frontend/issuable/issuable_form_spec.js
+++ b/spec/frontend/issuable/issuable_form_spec.js
@@ -35,8 +35,8 @@ describe('IssuableForm', () => {
let $description;
beforeEach(() => {
- $title = $form.find('input[name*="[title]"]');
- $description = $form.find('textarea[name*="[description]"]');
+ $title = $form.find('input[name*="[title]"]').get(0);
+ $description = $form.find('textarea[name*="[description]"]').get(0);
});
afterEach(() => {
@@ -103,7 +103,11 @@ describe('IssuableForm', () => {
createIssuable($form);
expect(Autosave).toHaveBeenCalledTimes(totalAutosaveFormFields);
- expect(Autosave).toHaveBeenLastCalledWith($input, ['/', '', id], `autosave///=${id}`);
+ expect(Autosave).toHaveBeenLastCalledWith(
+ $input.get(0),
+ ['/', '', id],
+ `autosave///=${id}`,
+ );
});
});