diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-14 18:08:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-14 18:08:05 +0300 |
commit | 3e764061b3209d4deee2a55851d5d564a9f19d8b (patch) | |
tree | 9b6bd5edff70694e9426a86c15f355dab3a2c06d /spec/frontend/issues | |
parent | 363a1ea13879c755f9cd8018763d3a7bdf4bf1c7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/issues')
-rw-r--r-- | spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js | 14 | ||||
-rw-r--r-- | spec/frontend/issues/list/components/issues_list_app_spec.js | 13 |
2 files changed, 14 insertions, 13 deletions
diff --git a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js index 77d5a0579a4..9df8cacf81c 100644 --- a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js +++ b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js @@ -18,6 +18,7 @@ import { setSortPreferenceMutationResponse, setSortPreferenceMutationResponseWithErrors, } from 'jest/issues/list/mock_data'; +import { STATUS_ALL, STATUS_CLOSED, STATUS_OPEN } from '~/issues/constants'; import IssuesDashboardApp from '~/issues/dashboard/components/issues_dashboard_app.vue'; import getIssuesCountsQuery from '~/issues/dashboard/queries/get_issues_counts.query.graphql'; import { CREATED_DESC, i18n, UPDATED_DESC, urlSortParams } from '~/issues/list/constants'; @@ -36,7 +37,6 @@ import { TOKEN_TYPE_TYPE, } from '~/vue_shared/components/filtered_search_bar/constants'; import IssuableList from '~/vue_shared/issuable/list/components/issuable_list_root.vue'; -import { IssuableStates } from '~/vue_shared/issuable/list/constants'; import { emptyIssuesQueryResponse, issuesCountsQueryResponse, @@ -124,7 +124,7 @@ describe('IssuesDashboardApp component', () => { // eslint-disable-next-line jest/no-disabled-tests it.skip('renders IssuableList component', () => { expect(findIssuableList().props()).toMatchObject({ - currentTab: IssuableStates.Opened, + currentTab: STATUS_OPEN, hasNextPage: true, hasPreviousPage: false, hasScopedLabelsFeature: defaultProvide.hasScopedLabelsFeature, @@ -148,7 +148,7 @@ describe('IssuesDashboardApp component', () => { tabs: IssuesDashboardApp.IssuableListTabs, urlParams: { sort: urlSortParams[CREATED_DESC], - state: IssuableStates.Opened, + state: STATUS_OPEN, }, useKeysetPagination: true, }); @@ -283,7 +283,7 @@ describe('IssuesDashboardApp component', () => { describe('state', () => { it('is set from the url params', () => { - const initialState = IssuableStates.All; + const initialState = STATUS_ALL; setWindowLocation(`?state=${initialState}`); mountComponent(); @@ -375,16 +375,16 @@ describe('IssuesDashboardApp component', () => { beforeEach(() => { mountComponent(); - findIssuableList().vm.$emit('click-tab', IssuableStates.Closed); + findIssuableList().vm.$emit('click-tab', STATUS_CLOSED); }); it('updates ui to the new tab', () => { - expect(findIssuableList().props('currentTab')).toBe(IssuableStates.Closed); + expect(findIssuableList().props('currentTab')).toBe(STATUS_CLOSED); }); it('updates url to the new tab', () => { expect(findIssuableList().props('urlParams')).toMatchObject({ - state: IssuableStates.Closed, + state: STATUS_CLOSED, }); }); }); diff --git a/spec/frontend/issues/list/components/issues_list_app_spec.js b/spec/frontend/issues/list/components/issues_list_app_spec.js index 06993ab8e29..fd06141df70 100644 --- a/spec/frontend/issues/list/components/issues_list_app_spec.js +++ b/spec/frontend/issues/list/components/issues_list_app_spec.js @@ -25,10 +25,11 @@ import { import { createAlert, VARIANT_INFO } from '~/flash'; import { TYPENAME_USER } from '~/graphql_shared/constants'; import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils'; +import { STATUS_ALL, STATUS_CLOSED, STATUS_OPEN } from '~/issues/constants'; import CsvImportExportButtons from '~/issuable/components/csv_import_export_buttons.vue'; import IssuableByEmail from '~/issuable/components/issuable_by_email.vue'; import IssuableList from '~/vue_shared/issuable/list/components/issuable_list_root.vue'; -import { IssuableListTabs, IssuableStates } from '~/vue_shared/issuable/list/constants'; +import { IssuableListTabs } from '~/vue_shared/issuable/list/constants'; import EmptyStateWithAnyIssues from '~/issues/list/components/empty_state_with_any_issues.vue'; import EmptyStateWithoutAnyIssues from '~/issues/list/components/empty_state_without_any_issues.vue'; import IssuesListApp from '~/issues/list/components/issues_list_app.vue'; @@ -213,7 +214,7 @@ describe('CE IssuesListApp component', () => { initialSortBy: CREATED_DESC, issuables: getIssuesQueryResponse.data.project.issues.nodes, tabs: IssuableListTabs, - currentTab: IssuableStates.Opened, + currentTab: STATUS_OPEN, tabCounts: { opened: 1, closed: 1, @@ -431,7 +432,7 @@ describe('CE IssuesListApp component', () => { describe('state', () => { it('is set from the url params', () => { - const initialState = IssuableStates.All; + const initialState = STATUS_ALL; setWindowLocation(`?state=${initialState}`); wrapper = mountComponent(); @@ -644,16 +645,16 @@ describe('CE IssuesListApp component', () => { await waitForPromises(); router.push = jest.fn(); - findIssuableList().vm.$emit('click-tab', IssuableStates.Closed); + findIssuableList().vm.$emit('click-tab', STATUS_CLOSED); }); it('updates ui to the new tab', () => { - expect(findIssuableList().props('currentTab')).toBe(IssuableStates.Closed); + expect(findIssuableList().props('currentTab')).toBe(STATUS_CLOSED); }); it('updates url to the new tab', () => { expect(router.push).toHaveBeenCalledWith({ - query: expect.objectContaining({ state: IssuableStates.Closed }), + query: expect.objectContaining({ state: STATUS_CLOSED }), }); }); }); |