diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-14 06:10:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-14 06:10:47 +0300 |
commit | 04698e448a10aedea2f3ed37ffd0327e9b91426e (patch) | |
tree | 8804a89c577dc005d3135d830e28de572f80f05d /spec/frontend | |
parent | e7cc427bc63dccac50cc3ccda2976befcea1ecf5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
7 files changed, 34 insertions, 86 deletions
diff --git a/spec/frontend/ide/stores/modules/commit/actions_spec.js b/spec/frontend/ide/stores/modules/commit/actions_spec.js index 020bcac8c70..f9a961fc4a1 100644 --- a/spec/frontend/ide/stores/modules/commit/actions_spec.js +++ b/spec/frontend/ide/stores/modules/commit/actions_spec.js @@ -19,6 +19,17 @@ jest.mock('~/lib/utils/url_utility', () => ({ })); const TEST_COMMIT_SHA = '123456789'; +const COMMIT_RESPONSE = { + id: '123456', + short_id: '123', + message: 'test message', + committed_date: 'date', + parent_ids: [], + stats: { + additions: '1', + deletions: '2', + }, +}; describe('IDE commit module actions', () => { let mock; @@ -32,7 +43,9 @@ describe('IDE commit module actions', () => { mock = new MockAdapter(axios); jest.spyOn(router, 'push').mockImplementation(); - mock.onGet('/api/v1/projects/abcproject/repository/branches/master').reply(200); + mock + .onGet('/api/v1/projects/abcproject/repository/branches/master') + .reply(200, { commit: COMMIT_RESPONSE }); }); afterEach(() => { @@ -329,18 +342,6 @@ describe('IDE commit module actions', () => { }); describe('success', () => { - const COMMIT_RESPONSE = { - id: '123456', - short_id: '123', - message: 'test message', - committed_date: 'date', - parent_ids: '321', - stats: { - additions: '1', - deletions: '2', - }, - }; - beforeEach(() => { jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE }); }); @@ -544,18 +545,6 @@ describe('IDE commit module actions', () => { }); describe('first commit of a branch', () => { - const COMMIT_RESPONSE = { - id: '123456', - short_id: '123', - message: 'test message', - committed_date: 'date', - parent_ids: [], - stats: { - additions: '1', - deletions: '2', - }, - }; - it('commits TOGGLE_EMPTY_STATE mutation on empty repo', (done) => { jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE }); jest.spyOn(store, 'commit'); diff --git a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap b/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap index 1d34ed3c9ba..c3fd4a9bab2 100644 --- a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap +++ b/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap @@ -35,7 +35,7 @@ exports[`Alert integration settings form default state should match the default Incident template (optional) <gl-link-stub - href="/help/user/project/description_templates#create-an-issue-template" + href="/help/user/project/description_templates#creating-issue-templates" target="_blank" > <gl-icon-stub diff --git a/spec/frontend/issue_show/components/app_spec.js b/spec/frontend/issue_show/components/app_spec.js index 74d195e1eb2..ec2055ca7d1 100644 --- a/spec/frontend/issue_show/components/app_spec.js +++ b/spec/frontend/issue_show/components/app_spec.js @@ -423,9 +423,7 @@ describe('Issuable output', () => { }); it('shows the form if template names request is successful', () => { - const mockData = { - test: [{ name: 'test', id: 'test', project_path: '/', namespace_path: '/' }], - }; + const mockData = [{ name: 'Bug' }]; mock.onGet('/issuable-templates-path').reply(() => Promise.resolve([200, mockData])); return wrapper.vm.requestTemplatesAndShowForm().then(() => { diff --git a/spec/frontend/issue_show/components/fields/description_template_spec.js b/spec/frontend/issue_show/components/fields/description_template_spec.js index 446c03f70e1..9ebab31f1ad 100644 --- a/spec/frontend/issue_show/components/fields/description_template_spec.js +++ b/spec/frontend/issue_show/components/fields/description_template_spec.js @@ -14,10 +14,7 @@ describe('Issue description template component', () => { vm = new Component({ propsData: { formState, - issuableTemplates: { - test: [{ name: 'test', id: 'test', project_path: '/', namespace_path: '/' }], - }, - projectId: 1, + issuableTemplates: [{ name: 'test' }], projectPath: '/', projectNamespace: '/', }, @@ -26,7 +23,7 @@ describe('Issue description template component', () => { it('renders templates as JSON array in data attribute', () => { expect(vm.$el.querySelector('.js-issuable-selector').getAttribute('data-data')).toBe( - '{"test":[{"name":"test","id":"test","project_path":"/","namespace_path":"/"}]}', + '[{"name":"test"}]', ); }); diff --git a/spec/frontend/issue_show/components/form_spec.js b/spec/frontend/issue_show/components/form_spec.js index 3a38883d1ec..4e123f606f6 100644 --- a/spec/frontend/issue_show/components/form_spec.js +++ b/spec/frontend/issue_show/components/form_spec.js @@ -19,7 +19,6 @@ describe('Inline edit form component', () => { markdownPreviewPath: '/', markdownDocsPath: '/', projectPath: '/', - projectId: 1, projectNamespace: '/', }; @@ -43,11 +42,7 @@ describe('Inline edit form component', () => { }); it('renders template selector when templates exists', () => { - createComponent({ - issuableTemplates: { - test: [{ name: 'test', id: 'test', project_path: 'test', namespace_path: 'test' }], - }, - }); + createComponent({ issuableTemplates: ['test'] }); expect(vm.$el.querySelector('.js-issuable-selector-wrap')).not.toBeNull(); }); diff --git a/spec/frontend/issue_show/mock_data.js b/spec/frontend/issue_show/mock_data.js index fd08c95b454..5a31a550088 100644 --- a/spec/frontend/issue_show/mock_data.js +++ b/spec/frontend/issue_show/mock_data.js @@ -52,7 +52,6 @@ export const appProps = { markdownDocsPath: '/', projectNamespace: '/', projectPath: '/', - projectId: 1, issuableTemplateNamesPath: '/issuable-templates-path', zoomMeetingUrl, publishedIncidentUrl, diff --git a/spec/frontend/reports/components/grouped_test_reports_app_spec.js b/spec/frontend/reports/components/grouped_test_reports_app_spec.js index 55901665719..492192988fb 100644 --- a/spec/frontend/reports/components/grouped_test_reports_app_spec.js +++ b/spec/frontend/reports/components/grouped_test_reports_app_spec.js @@ -22,7 +22,7 @@ describe('Grouped test reports app', () => { let wrapper; let mockStore; - const mountComponent = ({ props = { pipelinePath }, testFailureHistory = false } = {}) => { + const mountComponent = ({ props = { pipelinePath } } = {}) => { wrapper = mount(Component, { store: mockStore, localVue, @@ -31,11 +31,6 @@ describe('Grouped test reports app', () => { pipelinePath, ...props, }, - provide: { - glFeatures: { - testFailureHistory, - }, - }, }); }; @@ -242,50 +237,25 @@ describe('Grouped test reports app', () => { describe('with recent failures counts', () => { beforeEach(() => { setReports(recentFailuresTestReports); + mountComponent(); }); - describe('with feature flag enabled', () => { - beforeEach(() => { - mountComponent({ testFailureHistory: true }); - }); - - it('renders the recently failed tests summary', () => { - expect(findHeader().text()).toContain( - '2 out of 3 failed tests have failed more than once in the last 14 days', - ); - }); - - it('renders the recently failed count on the test suite', () => { - expect(findSummaryDescription().text()).toContain( - '1 out of 2 failed tests has failed more than once in the last 14 days', - ); - }); - - it('renders the recent failures count on the test case', () => { - expect(findIssueDescription().text()).toContain( - 'Failed 8 times in master in the last 14 days', - ); - }); + it('renders the recently failed tests summary', () => { + expect(findHeader().text()).toContain( + '2 out of 3 failed tests have failed more than once in the last 14 days', + ); }); - describe('with feature flag disabled', () => { - beforeEach(() => { - mountComponent({ testFailureHistory: false }); - }); - - it('does not render the recently failed tests summary', () => { - expect(findHeader().text()).not.toContain('failed more than once in the last 14 days'); - }); - - it('does not render the recently failed count on the test suite', () => { - expect(findSummaryDescription().text()).not.toContain( - 'failed more than once in the last 14 days', - ); - }); + it('renders the recently failed count on the test suite', () => { + expect(findSummaryDescription().text()).toContain( + '1 out of 2 failed tests has failed more than once in the last 14 days', + ); + }); - it('renders the recent failures count on the test case', () => { - expect(findIssueDescription().text()).not.toContain('in the last 14 days'); - }); + it('renders the recent failures count on the test case', () => { + expect(findIssueDescription().text()).toContain( + 'Failed 8 times in master in the last 14 days', + ); }); }); |