Skip to content

Commit 56b3b76

Browse files
chore: add test for dahboard details failing to load
1 parent b7d1abb commit 56b3b76

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

cypress/e2e/view_errors.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Feature: Errors while in view mode
1919
When I open the "Delivery" dashboard
2020
Then the "Delivery" dashboard displays in view mode
2121

22+
@nonmutating
23+
Scenario: I navigate to a dashboard that fails to load
24+
Given I type a dashboard id in the browser url that fails to load
25+
Then a warning message is displayed stating that the dashboard could not be loaded
26+
2227
# @nonmutating
2328
# Scenario: I navigate to print dashboard that doesn't exist
2429
# Given I type an invalid print dashboard id in the browser url
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
2+
3+
When('I type a dashboard id in the browser url that fails to load', () => {
4+
console.log('TEST RUNS')
5+
6+
cy.intercept('**/dashboards/iMnYyBfSxmM**', {
7+
statusCode: 500,
8+
body: 'Oopsie!',
9+
}).as('failure')
10+
11+
cy.visit('#/iMnYyBfSxmM')
12+
cy.wait('@failure')
13+
})
14+
15+
Then(
16+
'a warning message is displayed stating that the dashboard could not be loaded',
17+
() => {
18+
cy.contains('Load dashboard failed').should('exist')
19+
cy.contains(
20+
'This dashboard could not be loaded. Please try again later.'
21+
).should('exist')
22+
}
23+
)

0 commit comments

Comments
 (0)