0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

Fixed tests

This commit is contained in:
Rishabh 2022-06-01 02:05:53 +05:30
parent e320af30ae
commit bf12fb935d

View file

@ -420,11 +420,12 @@ describe('Signup', () => {
test('with only paid plans available', async () => { test('with only paid plans available', async () => {
let { let {
ghostApi, popupFrame, triggerButtonFrame, emailInput, nameInput, signinButton, chooseBtns, ghostApi, popupFrame, popupIframeDocument, triggerButtonFrame, emailInput, nameInput, signinButton,
siteTitle, freePlanTitle, monthlyPlanTitle, yearlyPlanTitle siteTitle, freePlanTitle, monthlyPlanTitle, yearlyPlanTitle
} = await setup({ } = await setup({
site: FixtureSite.singleTier.onlyPaidPlan site: FixtureSite.singleTier.onlyPaidPlan
}); });
const submitButton = within(popupIframeDocument).queryAllByRole('button', {name: 'Continue'});
expect(popupFrame).toBeInTheDocument(); expect(popupFrame).toBeInTheDocument();
expect(triggerButtonFrame).toBeInTheDocument(); expect(triggerButtonFrame).toBeInTheDocument();
@ -435,7 +436,7 @@ describe('Signup', () => {
expect(monthlyPlanTitle).toBeInTheDocument(); expect(monthlyPlanTitle).toBeInTheDocument();
expect(yearlyPlanTitle).toBeInTheDocument(); expect(yearlyPlanTitle).toBeInTheDocument();
expect(signinButton).toBeInTheDocument(); expect(signinButton).toBeInTheDocument();
expect(chooseBtns).toHaveLength(1); expect(submitButton).toHaveLength(1);
fireEvent.change(emailInput, {target: {value: 'jamie@example.com'}}); fireEvent.change(emailInput, {target: {value: 'jamie@example.com'}});
fireEvent.change(nameInput, {target: {value: 'Jamie Larsen'}}); fireEvent.change(nameInput, {target: {value: 'Jamie Larsen'}});
@ -443,7 +444,7 @@ describe('Signup', () => {
expect(emailInput).toHaveValue('jamie@example.com'); expect(emailInput).toHaveValue('jamie@example.com');
expect(nameInput).toHaveValue('Jamie Larsen'); expect(nameInput).toHaveValue('Jamie Larsen');
fireEvent.click(chooseBtns[0]); fireEvent.click(submitButton[0]);
const singleTierProduct = FixtureSite.singleTier.basic.products.find(p => p.type === 'paid'); const singleTierProduct = FixtureSite.singleTier.basic.products.find(p => p.type === 'paid');
expect(ghostApi.member.checkoutPlan).toHaveBeenLastCalledWith({ expect(ghostApi.member.checkoutPlan).toHaveBeenLastCalledWith({