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
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/incidents/incident_details_spec.rb4
-rw-r--r--spec/features/issues/issue_detail_spec.rb2
-rw-r--r--spec/features/projects/network_graph_spec.rb18
-rw-r--r--spec/finders/group_members_finder_spec.rb2
-rw-r--r--spec/frontend/__helpers__/vuex_action_helper_spec.js3
-rw-r--r--spec/frontend/api_spec.js2
-rw-r--r--spec/frontend/issues/show/components/fields/type_spec.js62
-rw-r--r--spec/frontend/lib/utils/icon_utils_spec.js5
-rw-r--r--spec/frontend/persistent_user_callout_spec.js6
-rw-r--r--spec/frontend/vue_merge_request_widget/extentions/terraform/index_spec.js6
-rw-r--r--spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js9
-rw-r--r--spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/mutations_spec.js12
-rw-r--r--spec/frontend/vue_shared/security_reports/security_reports_app_spec.js5
-rw-r--r--spec/lib/peek/views/active_record_spec.rb2
-rw-r--r--spec/models/note_spec.rb11
-rw-r--r--spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb3
-rw-r--r--spec/services/todos/destroy/group_private_service_spec.rb2
17 files changed, 82 insertions, 72 deletions
diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb
index 34f8dadcf11..e070d88875d 100644
--- a/spec/features/incidents/incident_details_spec.rb
+++ b/spec/features/incidents/incident_details_spec.rb
@@ -98,7 +98,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
page.within('[data-testid="issuable-form"]') do
click_button 'Issue'
- click_button 'Incident'
+ find('[data-testid="issue-type-list-item"]', text: 'Incident').click
click_button 'Save changes'
wait_for_requests
@@ -117,7 +117,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
page.within('[data-testid="issuable-form"]') do
click_button 'Incident'
- click_button 'Issue'
+ find('[data-testid="issue-type-list-item"]', text: 'Issue').click
click_button 'Save changes'
wait_for_requests
diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb
index 5af761ad7a4..20a69c61871 100644
--- a/spec/features/issues/issue_detail_spec.rb
+++ b/spec/features/issues/issue_detail_spec.rb
@@ -170,7 +170,7 @@ RSpec.describe 'Issue Detail', :js, feature_category: :team_planning do
def update_type_select(from, to)
click_button from
- click_button to
+ find('[data-testid="issue-type-list-item"]', text: to).click
click_button 'Save changes'
wait_for_requests
diff --git a/spec/features/projects/network_graph_spec.rb b/spec/features/projects/network_graph_spec.rb
index b36fde8a2bf..a29c9f58195 100644
--- a/spec/features/projects/network_graph_spec.rb
+++ b/spec/features/projects/network_graph_spec.rb
@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
let(:user) { create :user }
let(:project) { create :project, :repository, namespace: user.namespace }
+ let(:ref_selector) { '.ref-selector' }
before do
sign_in(user)
@@ -16,10 +17,13 @@ RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
shared_examples 'network graph' do
context 'when branch is master' do
def switch_ref_to(ref_name)
- first('.js-project-refs-dropdown').click
+ first(ref_selector).click
+ wait_for_requests
- page.within '.project-refs-form' do
- click_link ref_name
+ page.within ref_selector do
+ fill_in 'Search by Git revision', with: ref_name
+ wait_for_requests
+ find('li', text: ref_name, match: :prefer_exact).click
end
end
@@ -33,7 +37,7 @@ RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
it 'renders project network' do
expect(page).to have_selector ".network-graph"
- expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
+ expect(page).to have_selector ref_selector, text: "master"
page.within '.network-graph' do
expect(page).to have_content 'master'
end
@@ -42,7 +46,7 @@ RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
it 'switches ref to branch' do
switch_ref_to('feature')
- expect(page).to have_selector '.dropdown-menu-toggle', text: 'feature'
+ expect(page).to have_selector ref_selector, text: 'feature'
page.within '.network-graph' do
expect(page).to have_content 'feature'
end
@@ -51,7 +55,7 @@ RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
it 'switches ref to tag' do
switch_ref_to('v1.0.0')
- expect(page).to have_selector '.dropdown-menu-toggle', text: 'v1.0.0'
+ expect(page).to have_selector ref_selector, text: 'v1.0.0'
page.within '.network-graph' do
expect(page).to have_content 'v1.0.0'
end
@@ -64,7 +68,7 @@ RSpec.describe 'Project Network Graph', :js, feature_category: :projects do
end
expect(page).to have_selector ".network-graph"
- expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
+ expect(page).to have_selector ref_selector, text: "master"
page.within '.network-graph' do
expect(page).to have_content 'v1.0.0'
end
diff --git a/spec/finders/group_members_finder_spec.rb b/spec/finders/group_members_finder_spec.rb
index 0d1b58e2636..7462b108027 100644
--- a/spec/finders/group_members_finder_spec.rb
+++ b/spec/finders/group_members_finder_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe GroupMembersFinder, '#execute' do
+RSpec.describe GroupMembersFinder, '#execute', feature_category: :subgroups do
let_it_be(:group) { create(:group) }
let_it_be(:sub_group) { create(:group, parent: group) }
let_it_be(:sub_sub_group) { create(:group, parent: sub_group) }
diff --git a/spec/frontend/__helpers__/vuex_action_helper_spec.js b/spec/frontend/__helpers__/vuex_action_helper_spec.js
index 182aea9c1c5..a78f557d2be 100644
--- a/spec/frontend/__helpers__/vuex_action_helper_spec.js
+++ b/spec/frontend/__helpers__/vuex_action_helper_spec.js
@@ -1,6 +1,7 @@
import MockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'helpers/test_constants';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import testActionFn from './vuex_action_helper';
const testActionFnWithOptionsArg = (...args) => {
@@ -110,7 +111,7 @@ describe.each([testActionFn, testActionFnWithOptionsArg])(
});
it('returns original error of rejected promise while checking actions/mutations', async () => {
- mock.onGet(TEST_HOST).replyOnce(500, '');
+ mock.onGet(TEST_HOST).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, '');
assertion = { mutations: [{ type: 'ERROR' }], actions: [{ type: 'ACTION' }] };
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index f382a407c67..b9d68587fa5 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -625,7 +625,7 @@ describe('Api', () => {
const query = 'dummy query';
const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/projects.json`;
- mock.onGet(expectedUrl).reply(500, null);
+ mock.onGet(expectedUrl).reply(HTTP_STATUS_INTERNAL_SERVER_ERROR, null);
const apiCall = Api.groupProjects(groupId, query, {});
await expect(apiCall).rejects.toThrow();
});
diff --git a/spec/frontend/issues/show/components/fields/type_spec.js b/spec/frontend/issues/show/components/fields/type_spec.js
index 3333ceffca9..27ac0e1baf3 100644
--- a/spec/frontend/issues/show/components/fields/type_spec.js
+++ b/spec/frontend/issues/show/components/fields/type_spec.js
@@ -1,5 +1,5 @@
-import { GlFormGroup, GlDropdown, GlDropdownItem, GlIcon } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
+import { GlFormGroup, GlListbox, GlIcon } from '@gitlab/ui';
+import { mount, shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
@@ -32,17 +32,16 @@ describe('Issue type field component', () => {
},
};
- const findTypeFromGroup = () => wrapper.findComponent(GlFormGroup);
- const findTypeFromDropDown = () => wrapper.findComponent(GlDropdown);
- const findTypeFromDropDownItems = () => wrapper.findAllComponents(GlDropdownItem);
- const findTypeFromDropDownItemAt = (at) => findTypeFromDropDownItems().at(at);
- const findTypeFromDropDownItemIconAt = (at) =>
- findTypeFromDropDownItems().at(at).findComponent(GlIcon);
+ const findListBox = () => wrapper.findComponent(GlListbox);
+ const findFormGroup = () => wrapper.findComponent(GlFormGroup);
+ const findAllIssueItems = () => wrapper.findAll('[data-testid="issue-type-list-item"]');
+ const findIssueItemAt = (at) => findAllIssueItems().at(at);
+ const findIssueItemAtIcon = (at) => findAllIssueItems().at(at).findComponent(GlIcon);
- const createComponent = ({ data } = {}, provide) => {
+ const createComponent = (mountFn = mount, { data } = {}, provide) => {
fakeApollo = createMockApollo([], mockResolvers);
- wrapper = shallowMount(IssueTypeField, {
+ wrapper = mountFn(IssueTypeField, {
apolloProvider: fakeApollo,
data() {
return {
@@ -59,7 +58,6 @@ describe('Issue type field component', () => {
beforeEach(() => {
mockIssueStateData = jest.fn();
- createComponent();
});
afterEach(() => {
@@ -71,48 +69,60 @@ describe('Issue type field component', () => {
${0} | ${issuableTypes[0].text} | ${issuableTypes[0].icon}
${1} | ${issuableTypes[1].text} | ${issuableTypes[1].icon}
`(`renders the issue type $text with an icon in the dropdown`, ({ at, text, icon }) => {
- expect(findTypeFromDropDownItemIconAt(at).attributes('name')).toBe(icon);
- expect(findTypeFromDropDownItemAt(at).text()).toBe(text);
+ createComponent();
+
+ expect(findIssueItemAtIcon(at).props('name')).toBe(icon);
+ expect(findIssueItemAt(at).text()).toBe(text);
});
it('renders a form group with the correct label', () => {
- expect(findTypeFromGroup().attributes('label')).toBe(i18n.label);
+ createComponent(shallowMount);
+
+ expect(findFormGroup().attributes('label')).toBe(i18n.label);
});
it('renders a form select with the `issue_type` value', () => {
- expect(findTypeFromDropDown().attributes('value')).toBe(issuableTypes.issue);
+ createComponent();
+
+ expect(findListBox().attributes('value')).toBe(issuableTypes.issue);
});
describe('with Apollo cache mock', () => {
it('renders the selected issueType', async () => {
+ createComponent();
+
mockIssueStateData.mockResolvedValue(getIssueStateQueryResponse);
await waitForPromises();
- expect(findTypeFromDropDown().attributes('value')).toBe(issuableTypes.issue);
+ expect(findListBox().attributes('value')).toBe(issuableTypes.issue);
});
it('updates the `issue_type` in the apollo cache when the value is changed', async () => {
- findTypeFromDropDownItems().at(1).vm.$emit('click', issuableTypes.incident);
+ createComponent();
+
+ wrapper.vm.$emit('select', issuableTypes.incident);
await nextTick();
- expect(findTypeFromDropDown().attributes('value')).toBe(issuableTypes.incident);
+ expect(findListBox().attributes('value')).toBe(issuableTypes.incident);
});
describe('when user is a guest', () => {
it('hides the incident type from the dropdown', async () => {
- createComponent({}, { canCreateIncident: false, issueType: 'issue' });
+ createComponent(mount, {}, { canCreateIncident: false, issueType: 'issue' });
+
await waitForPromises();
- expect(findTypeFromDropDownItemAt(0).isVisible()).toBe(true);
- expect(findTypeFromDropDownItemAt(1).isVisible()).toBe(false);
- expect(findTypeFromDropDown().attributes('value')).toBe(issuableTypes.issue);
+ expect(findIssueItemAt(0).isVisible()).toBe(true);
+ expect(findIssueItemAt(1).isVisible()).toBe(false);
+ expect(findListBox().attributes('value')).toBe(issuableTypes.issue);
});
it('and incident is selected, includes incident in the dropdown', async () => {
- createComponent({}, { canCreateIncident: false, issueType: 'incident' });
+ createComponent(mount, {}, { canCreateIncident: false, issueType: 'incident' });
+
await waitForPromises();
- expect(findTypeFromDropDownItemAt(0).isVisible()).toBe(true);
- expect(findTypeFromDropDownItemAt(1).isVisible()).toBe(true);
- expect(findTypeFromDropDown().attributes('value')).toBe(issuableTypes.incident);
+ expect(findIssueItemAt(0).isVisible()).toBe(true);
+ expect(findIssueItemAt(1).isVisible()).toBe(true);
+ expect(findListBox().attributes('value')).toBe(issuableTypes.incident);
});
});
});
diff --git a/spec/frontend/lib/utils/icon_utils_spec.js b/spec/frontend/lib/utils/icon_utils_spec.js
index db1f174703b..f32c21fbb4f 100644
--- a/spec/frontend/lib/utils/icon_utils_spec.js
+++ b/spec/frontend/lib/utils/icon_utils_spec.js
@@ -1,5 +1,6 @@
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import { clearSvgIconPathContentCache, getSvgIconPathContent } from '~/lib/utils/icon_utils';
describe('Icon utils', () => {
@@ -50,9 +51,9 @@ describe('Icon utils', () => {
beforeEach(() => {
axiosMock
.onGet(gon.sprite_icons)
- .replyOnce(500)
+ .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR)
.onGet(gon.sprite_icons)
- .replyOnce(500)
+ .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR)
.onGet(gon.sprite_icons)
.reply(200, mockIcons);
});
diff --git a/spec/frontend/persistent_user_callout_spec.js b/spec/frontend/persistent_user_callout_spec.js
index cf97d69e1c1..6519989661f 100644
--- a/spec/frontend/persistent_user_callout_spec.js
+++ b/spec/frontend/persistent_user_callout_spec.js
@@ -3,7 +3,7 @@ import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
-import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status';
import PersistentUserCallout from '~/persistent_user_callout';
jest.mock('~/flash');
@@ -102,7 +102,7 @@ describe('PersistentUserCallout', () => {
});
it('invokes Flash when the dismiss request fails', async () => {
- mockAxios.onPost(dismissEndpoint).replyOnce(500);
+ mockAxios.onPost(dismissEndpoint).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR);
buttons.primary.click();
@@ -208,7 +208,7 @@ describe('PersistentUserCallout', () => {
});
it('invokes Flash when the dismiss request fails', async () => {
- mockAxios.onPost(dismissEndpoint).replyOnce(500);
+ mockAxios.onPost(dismissEndpoint).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR);
link.click();
diff --git a/spec/frontend/vue_merge_request_widget/extentions/terraform/index_spec.js b/spec/frontend/vue_merge_request_widget/extentions/terraform/index_spec.js
index d9faa7b2d25..b62ea542488 100644
--- a/spec/frontend/vue_merge_request_widget/extentions/terraform/index_spec.js
+++ b/spec/frontend/vue_merge_request_widget/extentions/terraform/index_spec.js
@@ -3,6 +3,7 @@ import { mountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import api from '~/api';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import Poll from '~/lib/utils/poll';
import extensionsContainer from '~/vue_merge_request_widget/components/extensions/container';
import { registerExtension } from '~/vue_merge_request_widget/components/extensions';
@@ -23,7 +24,6 @@ describe('Terraform extension', () => {
const endpoint = '/path/to/terraform/report.json';
const successStatusCode = 200;
- const errorStatusCode = 500;
const findListItem = (at) => wrapper.findAllByTestId('extension-list-item').at(at);
@@ -68,7 +68,7 @@ describe('Terraform extension', () => {
describe('when the fetching fails', () => {
beforeEach(() => {
- mockPollingApi(errorStatusCode, null, {});
+ mockPollingApi(HTTP_STATUS_INTERNAL_SERVER_ERROR, null, {});
return createComponent();
});
@@ -176,7 +176,7 @@ describe('Terraform extension', () => {
describe('polling fails', () => {
beforeEach(() => {
- mockPollingApi(errorStatusCode, null, {});
+ mockPollingApi(HTTP_STATUS_INTERNAL_SERVER_ERROR, null, {});
return createComponent();
});
diff --git a/spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js b/spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
index 0d329b6a065..ecbd322e17b 100644
--- a/spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
+++ b/spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
@@ -3,6 +3,7 @@ import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import MarkdownViewer from '~/vue_shared/components/content_viewer/viewers/markdown_viewer.vue';
jest.mock('~/behaviors/markdown/render_gfm');
@@ -100,9 +101,11 @@ describe('MarkdownViewer', () => {
describe('error', () => {
beforeEach(() => {
- mock.onPost(`${gon.relative_url_root}/testproject/preview_markdown`).replyOnce(500, {
- body: 'Internal Server Error',
- });
+ mock
+ .onPost(`${gon.relative_url_root}/testproject/preview_markdown`)
+ .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, {
+ body: 'Internal Server Error',
+ });
});
it('renders an error message if loading the markdown preview fails', () => {
createComponent();
diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/mutations_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/mutations_spec.js
index 66c6267027b..305f56255a5 100644
--- a/spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/mutations_spec.js
+++ b/spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/mutations_spec.js
@@ -1,6 +1,7 @@
import { get } from 'lodash';
import { mockBranches } from 'jest/vue_shared/components/filtered_search_bar/mock_data';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import * as types from '~/vue_shared/components/filtered_search_bar/store/modules/filters/mutation_types';
import mutations from '~/vue_shared/components/filtered_search_bar/store/modules/filters/mutations';
import initialState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
@@ -16,7 +17,6 @@ const labels = filterLabels.map(convertObjectPropsToCamelCase);
const filterValue = { value: 'foo' };
describe('Filters mutations', () => {
- const errorCode = 500;
beforeEach(() => {
state = initialState();
});
@@ -79,35 +79,35 @@ describe('Filters mutations', () => {
${types.RECEIVE_BRANCHES_SUCCESS} | ${'branches'} | ${'errorCode'} | ${null}
${types.RECEIVE_BRANCHES_ERROR} | ${'branches'} | ${'isLoading'} | ${false}
${types.RECEIVE_BRANCHES_ERROR} | ${'branches'} | ${'data'} | ${[]}
- ${types.RECEIVE_BRANCHES_ERROR} | ${'branches'} | ${'errorCode'} | ${errorCode}
+ ${types.RECEIVE_BRANCHES_ERROR} | ${'branches'} | ${'errorCode'} | ${HTTP_STATUS_INTERNAL_SERVER_ERROR}
${types.REQUEST_MILESTONES} | ${'milestones'} | ${'isLoading'} | ${true}
${types.RECEIVE_MILESTONES_SUCCESS} | ${'milestones'} | ${'isLoading'} | ${false}
${types.RECEIVE_MILESTONES_SUCCESS} | ${'milestones'} | ${'data'} | ${milestones}
${types.RECEIVE_MILESTONES_SUCCESS} | ${'milestones'} | ${'errorCode'} | ${null}
${types.RECEIVE_MILESTONES_ERROR} | ${'milestones'} | ${'isLoading'} | ${false}
${types.RECEIVE_MILESTONES_ERROR} | ${'milestones'} | ${'data'} | ${[]}
- ${types.RECEIVE_MILESTONES_ERROR} | ${'milestones'} | ${'errorCode'} | ${errorCode}
+ ${types.RECEIVE_MILESTONES_ERROR} | ${'milestones'} | ${'errorCode'} | ${HTTP_STATUS_INTERNAL_SERVER_ERROR}
${types.REQUEST_AUTHORS} | ${'authors'} | ${'isLoading'} | ${true}
${types.RECEIVE_AUTHORS_SUCCESS} | ${'authors'} | ${'isLoading'} | ${false}
${types.RECEIVE_AUTHORS_SUCCESS} | ${'authors'} | ${'data'} | ${users}
${types.RECEIVE_AUTHORS_SUCCESS} | ${'authors'} | ${'errorCode'} | ${null}
${types.RECEIVE_AUTHORS_ERROR} | ${'authors'} | ${'isLoading'} | ${false}
${types.RECEIVE_AUTHORS_ERROR} | ${'authors'} | ${'data'} | ${[]}
- ${types.RECEIVE_AUTHORS_ERROR} | ${'authors'} | ${'errorCode'} | ${errorCode}
+ ${types.RECEIVE_AUTHORS_ERROR} | ${'authors'} | ${'errorCode'} | ${HTTP_STATUS_INTERNAL_SERVER_ERROR}
${types.REQUEST_LABELS} | ${'labels'} | ${'isLoading'} | ${true}
${types.RECEIVE_LABELS_SUCCESS} | ${'labels'} | ${'isLoading'} | ${false}
${types.RECEIVE_LABELS_SUCCESS} | ${'labels'} | ${'data'} | ${labels}
${types.RECEIVE_LABELS_SUCCESS} | ${'labels'} | ${'errorCode'} | ${null}
${types.RECEIVE_LABELS_ERROR} | ${'labels'} | ${'isLoading'} | ${false}
${types.RECEIVE_LABELS_ERROR} | ${'labels'} | ${'data'} | ${[]}
- ${types.RECEIVE_LABELS_ERROR} | ${'labels'} | ${'errorCode'} | ${errorCode}
+ ${types.RECEIVE_LABELS_ERROR} | ${'labels'} | ${'errorCode'} | ${HTTP_STATUS_INTERNAL_SERVER_ERROR}
${types.REQUEST_ASSIGNEES} | ${'assignees'} | ${'isLoading'} | ${true}
${types.RECEIVE_ASSIGNEES_SUCCESS} | ${'assignees'} | ${'isLoading'} | ${false}
${types.RECEIVE_ASSIGNEES_SUCCESS} | ${'assignees'} | ${'data'} | ${users}
${types.RECEIVE_ASSIGNEES_SUCCESS} | ${'assignees'} | ${'errorCode'} | ${null}
${types.RECEIVE_ASSIGNEES_ERROR} | ${'assignees'} | ${'isLoading'} | ${false}
${types.RECEIVE_ASSIGNEES_ERROR} | ${'assignees'} | ${'data'} | ${[]}
- ${types.RECEIVE_ASSIGNEES_ERROR} | ${'assignees'} | ${'errorCode'} | ${errorCode}
+ ${types.RECEIVE_ASSIGNEES_ERROR} | ${'assignees'} | ${'errorCode'} | ${HTTP_STATUS_INTERNAL_SERVER_ERROR}
`('$mutation will set $stateKey with a given value', ({ mutation, rootKey, stateKey, value }) => {
mutations[mutation](state, value);
diff --git a/spec/frontend/vue_shared/security_reports/security_reports_app_spec.js b/spec/frontend/vue_shared/security_reports/security_reports_app_spec.js
index 43ff68e30b5..e6e9e486b11 100644
--- a/spec/frontend/vue_shared/security_reports/security_reports_app_spec.js
+++ b/spec/frontend/vue_shared/security_reports/security_reports_app_spec.js
@@ -16,6 +16,7 @@ import {
} from 'jest/vue_shared/security_reports/mock_data';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR } from '~/lib/utils/http_status';
import HelpIcon from '~/vue_shared/security_reports/components/help_icon.vue';
import SecurityReportDownloadDropdown from '~/vue_shared/security_reports/components/security_report_download_dropdown.vue';
import {
@@ -231,7 +232,7 @@ describe('Security reports app', () => {
describe('when an error occurs', () => {
beforeEach(() => {
- mock.onGet(path).replyOnce(500);
+ mock.onGet(path).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR);
createComponentWithFlagEnabled({
propsData: {
@@ -253,7 +254,7 @@ describe('Security reports app', () => {
describe('when the comparison endpoint is not provided', () => {
beforeEach(() => {
- mock.onGet(path).replyOnce(500);
+ mock.onGet(path).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR);
createComponentWithFlagEnabled();
diff --git a/spec/lib/peek/views/active_record_spec.rb b/spec/lib/peek/views/active_record_spec.rb
index fc768bdcb82..aeaf28c7e7d 100644
--- a/spec/lib/peek/views/active_record_spec.rb
+++ b/spec/lib/peek/views/active_record_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Peek::Views::ActiveRecord, :request_store do
+RSpec.describe Peek::Views::ActiveRecord, :request_store, feature_category: :database do
subject { Peek.views.find { |v| v.instance_of?(Peek::Views::ActiveRecord) } }
let(:connection_replica) { double(:connection_replica) }
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 4b574540500..27a4132c27e 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -1643,17 +1643,6 @@ RSpec.describe Note do
match_query_count(1).for_model(DiffNotePosition))
end
end
-
- context 'when skip_notes_diff_include flag is disabled' do
- before do
- stub_feature_flags(skip_notes_diff_include: false)
- end
-
- it 'includes additional diff associations' do
- expect { subject.reload }.to match_query_count(1).for_model(NoteDiffFile).and(
- match_query_count(1).for_model(DiffNotePosition))
- end
- end
end
context 'when noteable can have diffs' do
diff --git a/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb b/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb
index dd10c0df374..457be67c1ea 100644
--- a/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb
+++ b/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb
@@ -2,7 +2,8 @@
require 'spec_helper'
-RSpec.describe Ci::JobArtifacts::DestroyAllExpiredService, :clean_gitlab_redis_shared_state do
+RSpec.describe Ci::JobArtifacts::DestroyAllExpiredService, :clean_gitlab_redis_shared_state,
+feature_category: :build_artifacts do
include ExclusiveLeaseHelpers
let(:service) { described_class.new }
diff --git a/spec/services/todos/destroy/group_private_service_spec.rb b/spec/services/todos/destroy/group_private_service_spec.rb
index 30d02cb7400..be470688084 100644
--- a/spec/services/todos/destroy/group_private_service_spec.rb
+++ b/spec/services/todos/destroy/group_private_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Todos::Destroy::GroupPrivateService do
+RSpec.describe Todos::Destroy::GroupPrivateService, feature_category: :team_planning do
let(:group) { create(:group, :public) }
let(:project) { create(:project, group: group) }
let(:user) { create(:user) }