forked from mate-academy/js_sliding-tree-DOM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
js_sliding-tree-DOM: Cypress tests added (mate-academy#230)
* tests added * tests added * tests refactored * tests refactored ones again * tests changed using jquery * fix grammar * locators renamed * small changes Co-authored-by: y.kostenko <[email protected]> Co-authored-by: Roman Apostol <[email protected]>
- Loading branch information
1 parent
e4bad1d
commit 8209500
Showing
4 changed files
with
42 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 was deleted.
Oops, something went wrong.
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,26 @@ | ||
'use strict'; | ||
|
||
Cypress.Commands.add('toggleTree', (selector) => { | ||
cy.contains(selector).click(); | ||
cy.contains(selector).parent().find('ul').should('not.be.visible'); | ||
cy.contains(selector).click(); | ||
cy.contains(selector).parent().find('ul').should('be.visible'); | ||
}); | ||
|
||
describe(('Sliding tree'), () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it(`should hide/show first level <ul> elements by click `, () => { | ||
cy.toggleTree('Fruit'); | ||
cy.toggleTree('Fish'); | ||
}); | ||
|
||
it(`should hide/show second level <ul> elements by click`, () => { | ||
cy.toggleTree('Red'); | ||
cy.toggleTree('Yellow'); | ||
cy.toggleTree('Ocean fishes'); | ||
cy.toggleTree('Freshwater fish'); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.