Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
Merge pull request #5 from newfold-labs/update/test
Browse files Browse the repository at this point in the history
update before test to not wait on alias for fixture stubbed intercept
  • Loading branch information
circlecube authored Sep 19, 2023
2 parents 6013415 + 3ff3e76 commit d896de1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/cypress/integration/ctb.cy.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// <reference types="Cypress" />
const products = require('../fixtures/products.json');
const ctbGET = require('../fixtures/ctbGET.json');
const ctbPOST = require('../fixtures/ctbPOST.json');
const productsFixture = require('../fixtures/products.json');
const ctbGETFixture = require('../fixtures/ctbGET.json');
const ctbPOSTFixture = require('../fixtures/ctbPOST.json');

describe('Click to buy', function () {

before(() => {
cy.intercept({
method: 'GET',
url: /newfold-marketplace(\/|%2F)v1(\/|%2F)marketplace/
}, products ).as('products');
}, productsFixture );

cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/marketplace', {
onBeforeLoad() {
Expand All @@ -19,7 +19,7 @@ describe('Click to buy', function () {
});
}
});
cy.wait('@products');

});

it('Button has CTB Attributes', () => {
Expand All @@ -36,7 +36,7 @@ describe('Click to buy', function () {
cy.intercept({
method: 'GET',
url: /newfold-ctb(\/|%2F)v1(\/|%2F)ctb/,
}, ctbGET ).as('ctbGET');
}, ctbGETFixture ).as('ctbGET');

cy.get('body').should('not.have.class', 'noscroll');

Expand Down Expand Up @@ -96,12 +96,12 @@ describe('Click to buy', function () {
cy.intercept({
method: 'GET',
url: /newfold-ctb(\/|%2F)v1(\/|%2F)ctb/,
}, ctbGET ).as('ctbGET');
}, ctbGETFixture ).as('ctbGET');

cy.intercept({
method: 'POST',
url: /newfold-ctb(\/|%2F)v1(\/|%2F)ctb/,
}, ctbPOST ).as('ctbPOST');
}, ctbPOSTFixture ).as('ctbPOST');

// click CTB (again)
cy.get('[data-action="load-nfd-ctb"]').click();
Expand Down

0 comments on commit d896de1

Please sign in to comment.