Skip to content

Commit fe2b566

Browse files
committed
Add test and change task state totals for offline mode
1 parent 1abf5ee commit fe2b566

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

src/services/mock/json/workflows/multi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"submit-failed": 0,
4646
"submitted": 0,
4747
"running": 0,
48-
"failed": 0,
48+
"failed": 1,
4949
"succeeded": 0
5050
},
5151
"latestStateTasks": {},
@@ -73,7 +73,7 @@
7373
"preparing": 0,
7474
"submit-failed": 0,
7575
"submitted": 0,
76-
"running": 0,
76+
"running": 3,
7777
"failed": 0,
7878
"succeeded": 0
7979
},

src/services/mock/json/workflows/one.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"expired": 0,
1616
"preparing": 0,
1717
"submit-failed": 0,
18-
"submitted": 0,
19-
"running": 1,
20-
"failed": 1,
18+
"submitted": 1,
19+
"running": 10,
20+
"failed": 2,
2121
"succeeded": 2
2222
},
2323
"latestStateTasks": {

tests/e2e/specs/gscan.cy.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('GScan component', () => {
106106
cy.get('[data-cy="filter task state"]')
107107
.click()
108108
.get('.v-select__content')
109-
.contains('.v-list-item', 'succeed')
109+
.contains('.v-list-item', 'succeeded')
110110
.click({ force: true })
111111
cy.get('.c-treeitem:visible')
112112
.should('have.length', 1)
@@ -171,6 +171,27 @@ describe('GScan component', () => {
171171
})
172172
})
173173

174+
describe('Task state badges', () => {
175+
it('collates task states up the tree', () => {
176+
cy.get('.c-gscan')
177+
.find('[data-node-name="other/multi"]').as('parent')
178+
.find('.node:first .task-state-badge')
179+
.should('have.length', 1)
180+
.should('have.class', 'running')
181+
.contains('3')
182+
// child run2 contributes the running tasks
183+
cy.get('@parent').find('[data-node-name="run2"] .task-state-badge')
184+
.should('have.length', 1)
185+
.should('have.class', 'running')
186+
.contains('3')
187+
// but child run1 is stopped and so doesn't contribute
188+
cy.get('@parent').find('[data-node-name="run1"] .task-state-badge')
189+
.should('have.length', 1)
190+
.should('have.class', 'failed')
191+
.contains('1')
192+
})
193+
})
194+
174195
describe('Warnings', () => {
175196
it('collates warnings up the tree', () => {
176197
// NOTE: Log events may be duplicated in offline-mode due to the way the

0 commit comments

Comments
 (0)