-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add test for dahboard details failing to load
- Loading branch information
1 parent
b7d1abb
commit 56b3b76
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
cypress/e2e/view_errors/error_while_fetching_dashboard_details.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { When, Then } from '@badeball/cypress-cucumber-preprocessor' | ||
|
||
When('I type a dashboard id in the browser url that fails to load', () => { | ||
console.log('TEST RUNS') | ||
|
||
cy.intercept('**/dashboards/iMnYyBfSxmM**', { | ||
statusCode: 500, | ||
body: 'Oopsie!', | ||
}).as('failure') | ||
|
||
cy.visit('#/iMnYyBfSxmM') | ||
cy.wait('@failure') | ||
}) | ||
|
||
Then( | ||
'a warning message is displayed stating that the dashboard could not be loaded', | ||
() => { | ||
cy.contains('Load dashboard failed').should('exist') | ||
cy.contains( | ||
'This dashboard could not be loaded. Please try again later.' | ||
).should('exist') | ||
} | ||
) |