From 8ba4ebc62d88070758f2031787d0af8bf11b69a1 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 26 Jun 2024 14:43:22 -0400 Subject: [PATCH 1/2] use appId for selector --- tests/cypress/integration/product-page.cy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cypress/integration/product-page.cy.js b/tests/cypress/integration/product-page.cy.js index 2e5008d..4eea563 100644 --- a/tests/cypress/integration/product-page.cy.js +++ b/tests/cypress/integration/product-page.cy.js @@ -1,6 +1,8 @@ const productPageFixtures = require( '../fixtures/product-page.json' ); describe( 'Product Page', function () { + const appClass = '.' + Cypress.env( 'appId' ); + beforeEach( () => { cy.intercept( { @@ -22,7 +24,8 @@ describe( 'Product Page', function () { it( 'Show loading state while fetching', () => { cy.get( - '.wppbh-app-marketplace-container div[aria-label="Fetching product details"]' + appClass + + '-app-marketplace-container div[aria-label="Fetching product details"]' ).should( 'be.visible' ); } ); @@ -45,7 +48,7 @@ describe( 'Product Page', function () { } ).as( 'productPageError' ); cy.wait( '@productPageError' ); - cy.get( '.wppbh-app-marketplace-container div[role="alert"]' ) + cy.get( appClass + '-app-marketplace-container div[role="alert"]' ) .find( 'img[alt="Dog walking with a leash"]' ) .should( 'exist' ) .and( 'be.visible' ); From f5ea08963e492b42adcf471cdb3e99f989947aa1 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 26 Jun 2024 14:52:57 -0400 Subject: [PATCH 2/2] and fix secondary link to use runtime brand --- components/marketplaceItem/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/marketplaceItem/index.js b/components/marketplaceItem/index.js index eb62bb2..ba40b59 100644 --- a/components/marketplaceItem/index.js +++ b/components/marketplaceItem/index.js @@ -179,7 +179,7 @@ const MarketplaceItem = ( { item, methods, constants } ) => { const generateSecondaryUrl = () => { if ( isInternal ) { - return `${ window.NewfoldRuntime.admin_url }admin.php?page=bluehost#/marketplace/product/${ item.secondaryUrl }`; + return `${ window.NewfoldRuntime.admin_url }admin.php?page=${ window.NewfoldRuntime.plugin.brand }#/marketplace/product/${ item.secondaryUrl }`; } return item.secondaryUrl;