Total Complexity | 8 |
Complexity/F | 1.14 |
Lines of Code | 48 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | describe('Login / Registration: Test show operations on templates', () => { |
||
2 | beforeEach(() => { |
||
3 | cy.setToInitialState() |
||
|
|||
4 | .then(() => { |
||
5 | return cy.loginViaApi(); |
||
6 | }) |
||
7 | .then(() => { |
||
8 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/settings/login/registration/index`); |
||
9 | }); |
||
10 | }); |
||
11 | |||
12 | it('@settings: General (all sales channels)', () => { |
||
13 | cy.window().then((win) => { |
||
14 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_10555')) { |
||
15 | return; |
||
16 | } |
||
17 | |||
18 | // Request we want to wait for later |
||
19 | cy.server(); |
||
20 | cy.route({ |
||
21 | url: `${Cypress.env('apiPath')}/_action/system-config/batch`, |
||
22 | method: 'post' |
||
23 | }).as('saveSettings'); |
||
24 | |||
25 | cy.get('.sw-system-config__card--0 .sw-card__title').contains('General (all sales channels)'); |
||
26 | |||
27 | cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').scrollIntoView(); |
||
28 | cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').should('be.visible'); |
||
29 | |||
30 | cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').click().should('have.value', 'on'); |
||
31 | cy.get('.smart-bar__content .sw-button--primary').click(); |
||
32 | |||
33 | cy.wait('@saveSettings').then((xhr) => { |
||
34 | expect(xhr).to.have.property('status', 204); |
||
35 | }); |
||
36 | |||
37 | cy.get('.sw-sales-channel-switch').scrollIntoView(); |
||
38 | cy.get('#salesChannelSelect') |
||
39 | .typeSingleSelectAndCheck( |
||
40 | 'Storefront', |
||
41 | '#salesChannelSelect' |
||
42 | ); |
||
43 | |||
44 | cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').scrollIntoView(); |
||
45 | cy.get('input[name="core.systemWideLoginRegistration.isCustomerBoundToSalesChannel"]').should('have.value', 'on'); |
||
46 | }); |
||
47 | }); |
||
48 | }); |
||
49 |
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.