-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
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
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