Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 31 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | describe('Test if the cookie bar works correctly', () => { |
||
2 | beforeEach(() => { |
||
3 | cy.setToInitialState().then(() => { |
||
|
|||
4 | cy.visit('/'); |
||
5 | }); |
||
6 | }); |
||
7 | |||
8 | it('Should accept all cookies when user clicks on accept all in cookie bar', () => { |
||
9 | // should wait of cookieOffcanvas |
||
10 | cy.server(); |
||
11 | cy.route({ |
||
12 | url: '/cookie/offcanvas', |
||
13 | method: 'get' |
||
14 | }).as('cookieOffcanvas'); |
||
15 | |||
16 | cy.get('.cms-element-product-listing').should('be.visible'); |
||
17 | cy.get('.cookie-permission-container').should('be.visible'); |
||
18 | |||
19 | cy.get('.js-cookie-accept-all-button').should('be.visible') |
||
20 | .click(); |
||
21 | |||
22 | cy.wait('@cookieOffcanvas').then(() => { |
||
23 | cy.get('.offcanvas-cookie').should('not.be.visible'); |
||
24 | |||
25 | cy.reload(true); |
||
26 | |||
27 | cy.get('.cms-element-product-listing').should('be.visible'); |
||
28 | cy.get('.cookie-permission-container').should('not.be.visible'); |
||
29 | }); |
||
30 | }); |
||
31 | }); |
||
32 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.