Skip to content

Commit f4040f9

Browse files
Updated unit tests in regard to sorting
1 parent 798087f commit f4040f9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/utils/tasks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function compare (a, b, sortBy, sortDesc) {
167167
// All non median sorts
168168
ret = a[sortBy] < b[sortBy] ? -1 : 1
169169
}
170-
return sortDesc.value ? -ret : ret
170+
return sortDesc ? -ret : ret
171171
}
172172

173173
export function formatChartLabels (timingOption) {

tests/e2e/specs/analysis.cy.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
import { analysisTaskQuery } from '@/services/mock/json/index.cjs'
19-
import { clone } from 'lodash'
2019

2120
const sortedTasks = analysisTaskQuery.data.tasks.map(({ name }) => name).sort()
2221

@@ -341,15 +340,15 @@ describe('Analysis view', () => {
341340
.then((els) => {
342341
expect(
343342
Array.from(els, (i) => i.textContent)
344-
).to.deep.equal(sortedTasks)
343+
).to.deep.equal(['eventually_succeeded', 'succeeded', 'waiting'])
345344
})
346345
cy.get('[data-cy=box-plot-sort]')
347346
.click()
348347
.get('@taskLabels')
349348
.then((els) => {
350349
expect(
351350
Array.from(els, (i) => i.textContent)
352-
).to.deep.equal(clone(sortedTasks).reverse())
351+
).to.deep.equal(['waiting', 'succeeded', 'eventually_succeeded'])
353352
})
354353
})
355354
})

0 commit comments

Comments
 (0)