From ee55892c7497eae0f9c07b2e81c234512f6cac0c Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 17 Nov 2022 13:15:58 +0530 Subject: [PATCH] Updated portal tests refs https://github.com/TryGhost/Ghost/commit/dc032fac02ea71b52dda1bfc0a9ba9890d7360e5 --- ghost/portal/src/tests/SignupFlow.test.js | 2 -- .../portal/src/tests/data-attributes.test.js | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ghost/portal/src/tests/SignupFlow.test.js b/ghost/portal/src/tests/SignupFlow.test.js index 3d592ffa70..7387e7721f 100644 --- a/ghost/portal/src/tests/SignupFlow.test.js +++ b/ghost/portal/src/tests/SignupFlow.test.js @@ -376,8 +376,6 @@ describe('Signup', () => { tierId: singleTierProduct.id, cadence: 'year' }); - const magicLink = await within(popupIframeDocument).findByText(/now check your email/i); - expect(magicLink).toBeInTheDocument(); }); test('without name field on monthly plan', async () => { diff --git a/ghost/portal/src/tests/data-attributes.test.js b/ghost/portal/src/tests/data-attributes.test.js index 2747eb032b..c5f6d2c1f1 100644 --- a/ghost/portal/src/tests/data-attributes.test.js +++ b/ghost/portal/src/tests/data-attributes.test.js @@ -386,6 +386,29 @@ describe('Portal Data attributes:', () => { }); }); + describe('data-portal=signup/:tierid/monthly', () => { + test('opens Portal signup page', async () => { + const siteData = FixturesSite.singleTier.basic; + const paidTier = siteData.products.find(p => p.type === 'paid'); + + document.body.innerHTML = ` +
+ `; + let { + popupFrame, triggerButtonFrame, ...utils + } = await setup({ + site: FixturesSite.singleTier.basic, + showPopup: false + }); + expect(popupFrame).not.toBeInTheDocument(); + expect(triggerButtonFrame).toBeInTheDocument(); + const portalElement = document.querySelector('[data-portal]'); + fireEvent.click(portalElement); + popupFrame = await utils.findByTitle(/portal-popup/i); + expect(popupFrame).toBeInTheDocument(); + }); + }); + describe('data-portal=account', () => { test('opens Portal account home page', async () => { document.body.innerHTML = `