Commit c60b5cb8 authored by lauraMon's avatar lauraMon

Updates the specs

parent cbcf5829
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
}, },
mounted() { mounted() {
this.trackPageViews(); this.trackPageViews();
if(this.alertManagementEnabled) { if (this.alertManagementEnabled) {
findDefaultSortColumn().ariaSort = 'descending'; findDefaultSortColumn().ariaSort = 'descending';
} }
}, },
......
...@@ -48,7 +48,6 @@ describe('AlertManagementList', () => { ...@@ -48,7 +48,6 @@ describe('AlertManagementList', () => {
const findAssignees = () => wrapper.findAll('[data-testid="assigneesField"]'); const findAssignees = () => wrapper.findAll('[data-testid="assigneesField"]');
const findSeverityFields = () => wrapper.findAll('[data-testid="severityField"]'); const findSeverityFields = () => wrapper.findAll('[data-testid="severityField"]');
const findSeverityColumnHeader = () => wrapper.findAll('th').at(0); const findSeverityColumnHeader = () => wrapper.findAll('th').at(0);
const findStartTimeColumnHeader = () => wrapper.findAll('th').at(1);
const findPagination = () => wrapper.find(GlPagination); const findPagination = () => wrapper.find(GlPagination);
const alertsCount = { const alertsCount = {
open: 14, open: 14,
...@@ -333,7 +332,12 @@ describe('AlertManagementList', () => { ...@@ -333,7 +332,12 @@ describe('AlertManagementList', () => {
beforeEach(() => { beforeEach(() => {
mountComponent({ mountComponent({
props: { alertManagementEnabled: true, userCanEnableAlertManagement: true }, props: { alertManagementEnabled: true, userCanEnableAlertManagement: true },
data: { alerts: { list: mockAlerts }, errored: false, sort: 'STARTED_AT_ASC', alertsCount }, data: {
alerts: { list: mockAlerts },
errored: false,
sort: 'STARTED_AT_DESC',
alertsCount,
},
loading: false, loading: false,
stubs: { GlTable }, stubs: { GlTable },
}); });
...@@ -350,14 +354,11 @@ describe('AlertManagementList', () => { ...@@ -350,14 +354,11 @@ describe('AlertManagementList', () => {
}); });
it('updates the `ariaSort` attribute so the sort icon appears in the proper column', () => { it('updates the `ariaSort` attribute so the sort icon appears in the proper column', () => {
expect(findStartTimeColumnHeader().attributes('aria-sort')).toBe('ascending'); expect(mockStartedAtCol.ariaSort).toEqual('descending');
findSeverityColumnHeader().trigger('click'); findSeverityColumnHeader().trigger('click');
wrapper.vm.$nextTick(() => { expect(mockStartedAtCol.ariaSort).toEqual('none');
expect(findStartTimeColumnHeader().attributes('aria-sort')).toBe('none');
expect(findSeverityColumnHeader().attributes('aria-sort')).toBe('ascending');
});
}); });
}); });
......
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