diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-08 03:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-08 03:10:07 +0300 |
commit | 6214ac71ff96ebd17254be4dfbebc94226da78e5 (patch) | |
tree | 40d06509e45b3a2d2af9b29b9bfa2b8f7f7c5aba /spec/frontend/incidents | |
parent | 96135034f442825a54cea2812192133d376fbc4b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/incidents')
-rw-r--r-- | spec/frontend/incidents/components/incidents_list_spec.js | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/spec/frontend/incidents/components/incidents_list_spec.js b/spec/frontend/incidents/components/incidents_list_spec.js index df681658081..c7286d70b94 100644 --- a/spec/frontend/incidents/components/incidents_list_spec.js +++ b/spec/frontend/incidents/components/incidents_list_spec.js @@ -270,22 +270,25 @@ describe('Incidents List', () => { const noneSort = 'none'; it.each` - selector | initialSort | firstSort | nextSort - ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} - ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} - ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} - ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} - `('updates sort with new direction', async ({ selector, initialSort, firstSort, nextSort }) => { - const [[attr, value]] = Object.entries(selector); - const columnHeader = () => wrapper.find(`[${attr}="${value}"]`); - expect(columnHeader().attributes('aria-sort')).toBe(initialSort); - columnHeader().trigger('click'); - await wrapper.vm.$nextTick(); - expect(columnHeader().attributes('aria-sort')).toBe(firstSort); - columnHeader().trigger('click'); - await wrapper.vm.$nextTick(); - expect(columnHeader().attributes('aria-sort')).toBe(nextSort); - }); + description | selector | initialSort | firstSort | nextSort + ${'creation date'} | ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} + ${'severity'} | ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} + ${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} + ${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} + `( + 'updates sort with new direction when sorting by $description', + async ({ selector, initialSort, firstSort, nextSort }) => { + const [[attr, value]] = Object.entries(selector); + const columnHeader = () => wrapper.find(`[${attr}="${value}"]`); + expect(columnHeader().attributes('aria-sort')).toBe(initialSort); + columnHeader().trigger('click'); + await wrapper.vm.$nextTick(); + expect(columnHeader().attributes('aria-sort')).toBe(firstSort); + columnHeader().trigger('click'); + await wrapper.vm.$nextTick(); + expect(columnHeader().attributes('aria-sort')).toBe(nextSort); + }, + ); }); describe('Snowplow tracking', () => { |