fix bug 16 and 17
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 56s
Build & Push / Build & Push Docker Image (push) Failing after 4m53s
Test / API Unit Tests (push) Successful in 1m15s
Test / Homepage Unit Tests (push) Successful in 46s
Test / Carplace Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m6s
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 56s
Build & Push / Build & Push Docker Image (push) Failing after 4m53s
Test / API Unit Tests (push) Successful in 1m15s
Test / Homepage Unit Tests (push) Successful in 46s
Test / Carplace Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m6s
This commit is contained in:
@@ -15,7 +15,13 @@ describe('PricingSection', () => {
|
||||
const user = userEvent.setup();
|
||||
const content = buildHomepageContent(enHomepage, enShell).pricing;
|
||||
const { container } = render(
|
||||
<PricingSection content={content} locale="en" homePath="/en/system" demoSubmissionEnabled />,
|
||||
<PricingSection
|
||||
content={content}
|
||||
locale="en"
|
||||
themePreference="light"
|
||||
homePath="/en/system"
|
||||
demoSubmissionEnabled
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(container.querySelector('[data-plan="launch"]')).toHaveAttribute(
|
||||
@@ -30,15 +36,71 @@ describe('PricingSection', () => {
|
||||
'true',
|
||||
);
|
||||
expect(container.querySelector('[data-plan="launch"]')).not.toHaveAttribute('data-recommended');
|
||||
|
||||
await user.click(screen.getByLabelText('76–150 vehicles'));
|
||||
|
||||
expect(container.querySelector('[data-plan="pro"]')).toHaveAttribute(
|
||||
'data-recommended',
|
||||
'true',
|
||||
);
|
||||
expect(container.querySelector('[data-plan="growth"]')).not.toHaveAttribute('data-recommended');
|
||||
});
|
||||
|
||||
it('keeps unapproved public prices out of the rendered section', () => {
|
||||
it('renders approved public prices except for Enterprise custom pricing', async () => {
|
||||
const user = userEvent.setup();
|
||||
const content = buildHomepageContent(enHomepage, enShell).pricing;
|
||||
render(
|
||||
<PricingSection content={content} locale="en" homePath="/en/system" demoSubmissionEnabled />,
|
||||
<PricingSection
|
||||
content={content}
|
||||
locale="en"
|
||||
themePreference="light"
|
||||
homePath="/en/system"
|
||||
demoSubmissionEnabled
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getAllByText('Starting price pending approval')).toHaveLength(2);
|
||||
expect(screen.queryByText('Starting price pending approval')).not.toBeInTheDocument();
|
||||
expect(screen.getByText(/149/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/299/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/399/)).toBeInTheDocument();
|
||||
expect(screen.getByText('Custom pricing')).toBeInTheDocument();
|
||||
|
||||
await user.click(screen.getByLabelText(/Annual/));
|
||||
|
||||
expect(screen.getByText(/Save 20%/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/1,430/)).toBeInTheDocument();
|
||||
expect(screen.getAllByText('/ year')).toHaveLength(3);
|
||||
expect(screen.getAllByText('billed annually after full-payment discount')).toHaveLength(3);
|
||||
});
|
||||
|
||||
it('links self-serve plan CTAs to account creation and opens a pricing form for Enterprise', () => {
|
||||
const content = buildHomepageContent(enHomepage, enShell).pricing;
|
||||
render(
|
||||
<PricingSection
|
||||
content={content}
|
||||
locale="en"
|
||||
themePreference="dark"
|
||||
homePath="/en/system"
|
||||
demoSubmissionEnabled
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByRole('link', { name: 'Estimate Launch pricing' })).toHaveAttribute(
|
||||
'href',
|
||||
'/dashboard/sign-up?lang=en&theme=dark&plan=STARTER',
|
||||
);
|
||||
expect(screen.getByRole('link', { name: 'Book a Growth demo' })).toHaveAttribute(
|
||||
'href',
|
||||
'/dashboard/sign-up?lang=en&theme=dark&plan=GROWTH',
|
||||
);
|
||||
expect(screen.getByRole('link', { name: 'Book a Pro demo' })).toHaveAttribute(
|
||||
'href',
|
||||
'/dashboard/sign-up?lang=en&theme=dark&plan=PRO',
|
||||
);
|
||||
expect(screen.getByRole('button', { name: 'Talk to sales' })).toHaveAttribute(
|
||||
'data-demo-source',
|
||||
'pricing',
|
||||
);
|
||||
expect(screen.queryByRole('link', { name: 'Talk to sales' })).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user