-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TESTING] Adds test for Hedy's choice programs (#4460)
**Description** The Hedy's choice programs were not functioning for a while, so this tests makes sure that if they fail, it won't go unnoticed again. **Fixes #4407** **Checklist** Done? Check if you have it all in place using this list: (mark with x if done) - [ ] Contains one of the PR categories in the name - [ ] Describes changes in the format above - [ ] Links to an existing issue or discussion - [ ] Has a "How to test" section If you're unsure about any of these, don't hesitate to ask. We're here to help!
- Loading branch information
Showing
6 changed files
with
43 additions
and
10 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
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
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
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
27 changes: 27 additions & 0 deletions
27
tests/cypress/e2e/explore_programs_page/explore_programs.cy.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,27 @@ | ||
const { loginForAdmin } = require("../tools/login/login"); | ||
const { goToExploreProgramsPage } = require("../tools/navigation/nav"); | ||
|
||
describe('Explore programs page', () => { | ||
beforeEach(() => { | ||
loginForAdmin(); | ||
goToExploreProgramsPage(); | ||
}); | ||
|
||
it('When selecting a program as Hedys choice, it should be shown', ()=>{ | ||
// Get the id of the first program in the db | ||
cy.get('#explore_page_programs') | ||
.children() | ||
.first() | ||
.invoke('attr', 'data-cy') | ||
.as('program_id'); | ||
|
||
cy.get('@program_id').then(program_id => { | ||
// mark the program as Hedys choice | ||
cy.get(`#${program_id}`).click(); | ||
cy.get('#modal-yes-button').click(); | ||
// reload the page to see the changes | ||
cy.reload(); | ||
cy.get(`#explore_favourite_programs > [data-cy=${program_id}]`).should('be.visible'); | ||
}); | ||
}); | ||
}); |
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