diff options
author | Sarah German <sgerman@gitlab.com> | 2022-12-12 20:12:59 +0300 |
---|---|---|
committer | Suzanne Selhorn <sselhorn@gitlab.com> | 2022-12-12 20:12:59 +0300 |
commit | 44a6968c0e93823b3a28a720a6214ae8d87cd903 (patch) | |
tree | 79ff0dc8efb9ea38d699555481dd97c8a4b8bed9 /spec | |
parent | 10a3e5f53b216baa7154894578d0a25ee81be738 (diff) |
Add a breaking changes filter to the deprecations list
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/deprecations/deprecation_filters_spec.js | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/spec/frontend/deprecations/deprecation_filters_spec.js b/spec/frontend/deprecations/deprecation_filters_spec.js index d5149792..5cf28357 100644 --- a/spec/frontend/deprecations/deprecation_filters_spec.js +++ b/spec/frontend/deprecations/deprecation_filters_spec.js @@ -5,32 +5,14 @@ import { mount } from '@vue/test-utils'; import DeprecationFilters from '../../../content/frontend/deprecations/components/deprecation_filters.vue'; -const propsData = { showAllText: 'Show all', milestonesList: [{ value: '160', text: '16.0' }] }; +const propsData = { showAllText: 'Show all', milestonesOptions: [{ value: '160', text: '16.0' }] }; const removalsFilterSelector = '[data-testid="removal-milestone-filter"]'; +const breakingFilterSelector = '[data-testid="breaking-filter"]'; describe('component: Deprecations Filter', () => { - it('Filter is visible', () => { + it('Filters are visible', () => { const wrapper = mount(DeprecationFilters, { propsData }); expect(wrapper.find(removalsFilterSelector).isVisible()).toBe(true); - }); - - it('Validates a URL parameter', () => { - const location = { - ...window.location, - search: '?removal_milestone=16.0', - toString: () => { - return 'http://localhost/ee/update/deprecations.html'; - }, - }; - Object.defineProperty(window, 'location', { - writable: true, - value: location, - }); - - const searchParams = new URLSearchParams(window.location.search); - const versionValue = searchParams.get('removal_milestone').replace(/\./g, ''); - - const wrapper = mount(DeprecationFilters, { propsData }); - expect(wrapper.vm.isValidVersion(versionValue)).toBe(true); + expect(wrapper.find(breakingFilterSelector).isVisible()).toBe(true); }); }); |