Make test case descriptions more relevant

parent 850487e3
...@@ -270,22 +270,25 @@ describe('Incidents List', () => { ...@@ -270,22 +270,25 @@ describe('Incidents List', () => {
const noneSort = 'none'; const noneSort = 'none';
it.each` it.each`
selector | initialSort | firstSort | nextSort description | selector | initialSort | firstSort | nextSort
${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} ${'creation date'} | ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort}
${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} ${'severity'} | ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} ${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} ${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort}
`('updates sort with new direction', async ({ selector, initialSort, firstSort, nextSort }) => { `(
const [[attr, value]] = Object.entries(selector); 'updates sort with new direction when sorting by $description',
const columnHeader = () => wrapper.find(`[${attr}="${value}"]`); async ({ selector, initialSort, firstSort, nextSort }) => {
expect(columnHeader().attributes('aria-sort')).toBe(initialSort); const [[attr, value]] = Object.entries(selector);
columnHeader().trigger('click'); const columnHeader = () => wrapper.find(`[${attr}="${value}"]`);
await wrapper.vm.$nextTick(); expect(columnHeader().attributes('aria-sort')).toBe(initialSort);
expect(columnHeader().attributes('aria-sort')).toBe(firstSort); columnHeader().trigger('click');
columnHeader().trigger('click'); await wrapper.vm.$nextTick();
await wrapper.vm.$nextTick(); expect(columnHeader().attributes('aria-sort')).toBe(firstSort);
expect(columnHeader().attributes('aria-sort')).toBe(nextSort); columnHeader().trigger('click');
}); await wrapper.vm.$nextTick();
expect(columnHeader().attributes('aria-sort')).toBe(nextSort);
},
);
}); });
describe('Snowplow tracking', () => { describe('Snowplow tracking', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment