Skip to content

Commit

Permalink
Add e2e tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvinb committed Aug 22, 2024
1 parent fdcee7b commit 06feea2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions tests/e2e/specs/setup-mc/step-4-complete-campaign.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,27 @@ test.describe( 'Complete your campaign', () => {
).toBeVisible();
} );

test.describe( 'Free Ad Credit', () => {
test( 'shoud not see the Free Ad Credit section if the account is not eligible', async () => {
await expect(
page.getByText(
'Spend $500 to get $500 in Google Ads credits!'
)
).not.toBeVisible();
} );

test( 'should see the Free Ad Credit section if the account is eligible', async () => {
await setupAdsAccountPage.mockAdsSubAccountConnected();
await completeCampaign.goto();

await expect(
page.getByText(
'Spend $500 to get $500 in Google Ads credits!'
)
).toBeVisible();
} );
} );

test.describe( 'FAQ panels', () => {
test( 'should see five questions in FAQ', async () => {
const faqTitles = getFAQPanelTitle( page );
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/utils/mock-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export default class MockRequests {
* @param {number} [id=12345]
* @return {Promise<void>}
*/
async mockAdsSubAccountConnected( id = 12345 ) {
async mockAdsSubAccountConnected( id = 123456 ) {
await this.fulfillAdsConnection( {
id,
sub_account: true,
Expand Down

0 comments on commit 06feea2

Please sign in to comment.