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

This commit is contained in:
root
2026-08-04 00:52:58 -04:00
parent 626da23c2e
commit 149806a773
72 changed files with 834 additions and 174 deletions
@@ -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('76150 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();
});
});