diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-01 18:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-01 18:09:52 +0300 |
commit | 41aebff8ec728c167298aa44e037d8e324e00e8d (patch) | |
tree | f51c379dd4b78f9ecb57175e9dc073d6debe74e5 /spec/frontend | |
parent | 8c438dd7a6063d7f59bce4d79cc7ca49a31a8346 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
6 files changed, 29 insertions, 44 deletions
diff --git a/spec/frontend/filtered_search/filtered_search_manager_spec.js b/spec/frontend/filtered_search/filtered_search_manager_spec.js index 465e1ee1ef1..c03c8f6c529 100644 --- a/spec/frontend/filtered_search/filtered_search_manager_spec.js +++ b/spec/frontend/filtered_search/filtered_search_manager_spec.js @@ -185,7 +185,7 @@ describe('Filtered Search Manager', () => { }); describe('search', () => { - const defaultParams = '?scope=all&utf8=%E2%9C%93'; + const defaultParams = '?scope=all'; const defaultState = '&state=opened'; it('should search with a single word', (done) => { diff --git a/spec/frontend/incidents/components/incidents_list_spec.js b/spec/frontend/incidents/components/incidents_list_spec.js index c7286d70b94..8d4ccab2a40 100644 --- a/spec/frontend/incidents/components/incidents_list_spec.js +++ b/spec/frontend/incidents/components/incidents_list_spec.js @@ -43,12 +43,10 @@ describe('Incidents List', () => { const findLoader = () => wrapper.find(GlLoadingIcon); const findTimeAgo = () => wrapper.findAll(TimeAgoTooltip); const findAssignees = () => wrapper.findAll('[data-testid="incident-assignees"]'); - const findIncidentSlaHeader = () => wrapper.find('[data-testid="incident-management-sla"]'); const findCreateIncidentBtn = () => wrapper.find('[data-testid="createIncidentBtn"]'); const findClosedIcon = () => wrapper.findAll("[data-testid='incident-closed']"); const findEmptyState = () => wrapper.find(GlEmptyState); const findSeverity = () => wrapper.findAll(SeverityToken); - const findIncidentSla = () => wrapper.findAll("[data-testid='incident-sla']"); function mountComponent({ data = {}, loading = false, provide = {} } = {}) { wrapper = mount(IncidentsList, { @@ -188,35 +186,6 @@ describe('Incidents List', () => { joinPaths(`/project/issues/incident`, mockIncidents[0].iid), ); }); - - describe('Incident SLA field', () => { - it('displays the column when the feature is available', () => { - mountComponent({ - data: { incidents: { list: mockIncidents } }, - provide: { slaFeatureAvailable: true }, - }); - - expect(findIncidentSlaHeader().text()).toContain('Time to SLA'); - }); - - it('does not display the column when the feature is not available', () => { - mountComponent({ - data: { incidents: { list: mockIncidents } }, - provide: { slaFeatureAvailable: false }, - }); - - expect(findIncidentSlaHeader().exists()).toBe(false); - }); - - it('renders an SLA for each incident', () => { - mountComponent({ - data: { incidents: { list: mockIncidents } }, - provide: { slaFeatureAvailable: true }, - }); - - expect(findIncidentSla().length).toBe(mockIncidents.length); - }); - }); }); describe('Create Incident', () => { diff --git a/spec/frontend/issues_list/components/issuables_list_app_spec.js b/spec/frontend/issues_list/components/issuables_list_app_spec.js index fe3d2114463..a7f3dd81517 100644 --- a/spec/frontend/issues_list/components/issuables_list_app_spec.js +++ b/spec/frontend/issues_list/components/issuables_list_app_spec.js @@ -302,7 +302,6 @@ describe('Issuables list component', () => { my_reaction_emoji: 'airplane', scope: 'all', state: 'opened', - utf8: '✓', weight: '0', milestone: 'v3.0', labels: 'Aquapod,Astro', @@ -312,7 +311,7 @@ describe('Issuables list component', () => { describe('when page is not present in params', () => { const query = - '?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0¬[label_name][]=Afterpod¬[milestone_title][]=13'; + '?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&weight=0¬[label_name][]=Afterpod¬[milestone_title][]=13'; beforeEach(() => { setUrl(query); @@ -356,7 +355,7 @@ describe('Issuables list component', () => { describe('when page is present in the param', () => { const query = - '?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0&page=3'; + '?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&weight=0&page=3'; beforeEach(() => { setUrl(query); diff --git a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js index 3a0e899ada3..79a0ab006da 100644 --- a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js +++ b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js @@ -261,7 +261,7 @@ describe('ForkForm component', () => { }); describe('onSubmit', () => { - beforeEach(() => { + const setupComponent = (fields = {}) => { jest.spyOn(urlUtility, 'redirectTo').mockImplementation(); mockGetRequest(); @@ -271,9 +271,14 @@ describe('ForkForm component', () => { namespaces: MOCK_NAMESPACES_RESPONSE, form: { state: true, + ...fields, }, }, ); + }; + + beforeEach(() => { + setupComponent(); }); const selectedMockNamespaceIndex = 1; @@ -305,6 +310,23 @@ describe('ForkForm component', () => { expect(urlUtility.redirectTo).not.toHaveBeenCalled(); }); + + it('does not make POST request if no visbility is checked', async () => { + jest.spyOn(axios, 'post'); + + setupComponent({ + fields: { + visibility: { + value: null, + }, + }, + }); + + await submitForm(); + + expect(wrapper.find('[name="visibility"]:checked').exists()).toBe(false); + expect(axios.post).not.toHaveBeenCalled(); + }); }); describe('with valid form', () => { diff --git a/spec/frontend/projects/commit/components/form_modal_spec.js b/spec/frontend/projects/commit/components/form_modal_spec.js index 9688cb47799..0c8089430d0 100644 --- a/spec/frontend/projects/commit/components/form_modal_spec.js +++ b/spec/frontend/projects/commit/components/form_modal_spec.js @@ -159,12 +159,7 @@ describe('CommitFormModal', () => { }); it('Changes the target_project_id input value', async () => { - createComponent( - shallowMount, - {}, - { glFeatures: { pickIntoProject: true } }, - { isCherryPick: true }, - ); + createComponent(shallowMount, {}, {}, { isCherryPick: true }); findProjectsDropdown().vm.$emit('selectProject', '_changed_project_value_'); await wrapper.vm.$nextTick(); diff --git a/spec/frontend/tracking_spec.js b/spec/frontend/tracking_spec.js index 9d60f9232eb..ac1bb57d7da 100644 --- a/spec/frontend/tracking_spec.js +++ b/spec/frontend/tracking_spec.js @@ -232,7 +232,7 @@ describe('Tracking', () => { Tracking.bindDocument('_category_'); // only happens once setHTMLFixture(` <input data-track-${term}="click_input1" data-track-label="_label_" value="_value_"/> - <input data-track-${term}="click_input2" data-track-value="_value_override_" value="_value_"/> + <input data-track-${term}="click_input2" data-track-value="_value_override_" value=0/> <input type="checkbox" data-track-${term}="toggle_checkbox" value="_value_" checked/> <input class="dropdown" data-track-${term}="toggle_dropdown"/> <div data-track-${term}="nested_event"><span class="nested"></span></div> @@ -272,7 +272,7 @@ describe('Tracking', () => { checkbox.click(); // unchecking expect(eventSpy).toHaveBeenCalledWith('_category_', 'toggle_checkbox', { - value: false, + value: 0, }); checkbox.click(); // checking |