From c7bbc72842671d1451437d82588e3cc1f0bbbd37 Mon Sep 17 00:00:00 2001 From: Karthik Thayyil Date: Thu, 7 Nov 2024 03:32:38 +0000 Subject: [PATCH] check for text content in Summary+ mock add empty campaign. --- tests/e2e/specs/dashboard/paid-features.test.js | 3 ++- tests/e2e/utils/pages/dashboard.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/e2e/specs/dashboard/paid-features.test.js b/tests/e2e/specs/dashboard/paid-features.test.js index b68a99766a..9eace25aca 100644 --- a/tests/e2e/specs/dashboard/paid-features.test.js +++ b/tests/e2e/specs/dashboard/paid-features.test.js @@ -77,6 +77,7 @@ test.describe( 'Paid Feature Listing', () => { await page.close(); } ); test( 'When no campaign present', async () => { + await dashboardPage.fulfillAdsCampaignsRequest( [] ); await dashboardPage.goto(); await expect( dashboardPage.googleAdsSummaryCard ).toContainText( 'Google Ads' @@ -98,7 +99,7 @@ test.describe( 'Paid Feature Listing', () => { ] ); await dashboardPage.goto(); await expect( dashboardPage.googleAdsSummaryCard ).toContainText( - 'Google Ads' + /Google Ads.*Total Sales.*Total Spend/ ); await expect( dashboardPage.paidFeatures ).not.toBeVisible(); diff --git a/tests/e2e/utils/pages/dashboard.js b/tests/e2e/utils/pages/dashboard.js index e7deb3b5e1..b53bd867cc 100644 --- a/tests/e2e/utils/pages/dashboard.js +++ b/tests/e2e/utils/pages/dashboard.js @@ -63,6 +63,20 @@ export default class DashboardPage extends MockRequests { next_page: null, } ); + await this.fulfillAdsReportProgram( { + products: null, + campaigns: null, + intervals: null, + totals: { + sales: 0, + conversions: 0, + spend: 0, + clicks: 0, + impressions: 0, + }, + next_page: null, + } ); + await this.fulfillTargetAudience( { location: 'selected', countries: [ 'US' ],