Frontendtest OfferingFormPage: typen zonder pauze per toets (flaky onder CI-belasting)
Continuous Integration / config-asf (pull_request) Successful in 8s
Continuous Integration / config-sls (pull_request) Successful in 9s
Continuous Integration / changes (pull_request) Successful in 12s
Continuous Integration / backend-build (pull_request) Skipped
Continuous Integration / compile-sites (pull_request) Skipped
Continuous Integration / backend-test (pull_request) Skipped
Continuous Integration / vulnerability-scan (pull_request) Skipped
Continuous Integration / frontend-prepare (pull_request) Successful in 23s
Continuous Integration / frontend-build (pull_request) Successful in 39s
Continuous Integration / frontend-lint (pull_request) Successful in 41s
Continuous Integration / frontend-test (pull_request) Successful in 2m40s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped
Continuous Integration / config-asf (pull_request) Successful in 8s
Continuous Integration / config-sls (pull_request) Successful in 9s
Continuous Integration / changes (pull_request) Successful in 12s
Continuous Integration / backend-build (pull_request) Skipped
Continuous Integration / compile-sites (pull_request) Skipped
Continuous Integration / backend-test (pull_request) Skipped
Continuous Integration / vulnerability-scan (pull_request) Skipped
Continuous Integration / frontend-prepare (pull_request) Successful in 23s
Continuous Integration / frontend-build (pull_request) Successful in 39s
Continuous Integration / frontend-lint (pull_request) Successful in 41s
Continuous Integration / frontend-test (pull_request) Successful in 2m40s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,12 @@ import { renderApp, mockAuthenticated } from '@/test/utils';
|
|||||||
import { resetMockOfferings } from '@/features/offerings/mocks/handlers';
|
import { resetMockOfferings } from '@/features/offerings/mocks/handlers';
|
||||||
import { _resetSetupStatusCache } from '@/router';
|
import { _resetSetupStatusCache } from '@/router';
|
||||||
|
|
||||||
|
// No pause between keystrokes: the form is typed into dozens of characters per test and, with the default zero-delay
|
||||||
|
// timer between each, a loaded CI machine could take longer than the test timeout (20 s) in this one file.
|
||||||
|
let user: ReturnType<typeof userEvent.setup>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
user = userEvent.setup({ delay: null });
|
||||||
_resetSetupStatusCache();
|
_resetSetupStatusCache();
|
||||||
resetMockOfferings();
|
resetMockOfferings();
|
||||||
});
|
});
|
||||||
@@ -17,14 +22,14 @@ describe('OfferingFormPage', () => {
|
|||||||
|
|
||||||
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
||||||
|
|
||||||
await userEvent.type(screen.getByTestId('offering-title'), 'Enterprise');
|
await user.type(screen.getByTestId('offering-title'), 'Enterprise');
|
||||||
await userEvent.type(screen.getByTestId('offering-description'), 'A large website');
|
await user.type(screen.getByTestId('offering-description'), 'A large website');
|
||||||
await userEvent.type(screen.getByTestId('offering-price'), '€ 2000');
|
await user.type(screen.getByTestId('offering-price'), '€ 2000');
|
||||||
await userEvent.type(screen.getByTestId('offering-price-note'), 'one-time');
|
await user.type(screen.getByTestId('offering-price-note'), 'one-time');
|
||||||
await userEvent.type(screen.getByTestId('offering-feature-0'), 'Unlimited pages');
|
await user.type(screen.getByTestId('offering-feature-0'), 'Unlimited pages');
|
||||||
await userEvent.type(screen.getByTestId('offering-cta-label'), 'Contact us');
|
await user.type(screen.getByTestId('offering-cta-label'), 'Contact us');
|
||||||
|
|
||||||
await userEvent.click(screen.getByTestId('offering-form-submit'));
|
await user.click(screen.getByTestId('offering-form-submit'));
|
||||||
|
|
||||||
expect(await screen.findByTestId('offerings-title', {}, { timeout: 10000 })).toBeInTheDocument();
|
expect(await screen.findByTestId('offerings-title', {}, { timeout: 10000 })).toBeInTheDocument();
|
||||||
expect(screen.getByText('Enterprise')).toBeInTheDocument();
|
expect(screen.getByText('Enterprise')).toBeInTheDocument();
|
||||||
@@ -37,11 +42,11 @@ describe('OfferingFormPage', () => {
|
|||||||
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
||||||
expect(screen.getByLabelText(/optioneel|optional/i, { selector: '#offering-description' })).toBeInTheDocument();
|
expect(screen.getByLabelText(/optioneel|optional/i, { selector: '#offering-description' })).toBeInTheDocument();
|
||||||
|
|
||||||
await userEvent.type(screen.getByTestId('offering-title'), 'Gezin');
|
await user.type(screen.getByTestId('offering-title'), 'Gezin');
|
||||||
await userEvent.type(screen.getByTestId('offering-price'), '€ 175');
|
await user.type(screen.getByTestId('offering-price'), '€ 175');
|
||||||
await userEvent.type(screen.getByTestId('offering-feature-0'), '1 uur fotografie');
|
await user.type(screen.getByTestId('offering-feature-0'), '1 uur fotografie');
|
||||||
await userEvent.type(screen.getByTestId('offering-cta-label'), 'Boek');
|
await user.type(screen.getByTestId('offering-cta-label'), 'Boek');
|
||||||
await userEvent.click(screen.getByTestId('offering-form-submit'));
|
await user.click(screen.getByTestId('offering-form-submit'));
|
||||||
|
|
||||||
expect(await screen.findByTestId('offerings-title', {}, { timeout: 10000 })).toBeInTheDocument();
|
expect(await screen.findByTestId('offerings-title', {}, { timeout: 10000 })).toBeInTheDocument();
|
||||||
expect(screen.getByText('Gezin')).toBeInTheDocument();
|
expect(screen.getByText('Gezin')).toBeInTheDocument();
|
||||||
@@ -53,7 +58,7 @@ describe('OfferingFormPage', () => {
|
|||||||
renderApp('/offerings/new');
|
renderApp('/offerings/new');
|
||||||
|
|
||||||
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
||||||
await userEvent.click(screen.getByTestId('offering-form-submit'));
|
await user.click(screen.getByTestId('offering-form-submit'));
|
||||||
|
|
||||||
expect(await screen.findByTestId('offering-title-error')).toBeInTheDocument();
|
expect(await screen.findByTestId('offering-title-error')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -74,9 +79,9 @@ describe('OfferingFormPage', () => {
|
|||||||
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent(/automatisch|auto-generated/i);
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent(/automatisch|auto-generated/i);
|
||||||
|
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-edit'));
|
await user.click(screen.getByTestId('offering-slug-edit'));
|
||||||
await userEvent.type(screen.getByTestId('offering-slug'), 'custom-slug');
|
await user.type(screen.getByTestId('offering-slug'), 'custom-slug');
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-confirm'));
|
await user.click(screen.getByTestId('offering-slug-confirm'));
|
||||||
|
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('custom-slug');
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('custom-slug');
|
||||||
});
|
});
|
||||||
@@ -87,10 +92,10 @@ describe('OfferingFormPage', () => {
|
|||||||
|
|
||||||
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-form-submit', {}, { timeout: 10000 });
|
||||||
|
|
||||||
await userEvent.type(screen.getByTestId('offering-title'), 'Mijn Nieuwe Pakket');
|
await user.type(screen.getByTestId('offering-title'), 'Mijn Nieuwe Pakket');
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('mijn-nieuwe-pakket');
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('mijn-nieuwe-pakket');
|
||||||
|
|
||||||
await userEvent.type(screen.getByTestId('offering-title'), '!');
|
await user.type(screen.getByTestId('offering-title'), '!');
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('mijn-nieuwe-pakket');
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('mijn-nieuwe-pakket');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -99,13 +104,13 @@ describe('OfferingFormPage', () => {
|
|||||||
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
||||||
|
|
||||||
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-edit'));
|
await user.click(screen.getByTestId('offering-slug-edit'));
|
||||||
await userEvent.clear(screen.getByTestId('offering-slug'));
|
await user.clear(screen.getByTestId('offering-slug'));
|
||||||
await userEvent.type(screen.getByTestId('offering-slug'), 'manually-set');
|
await user.type(screen.getByTestId('offering-slug'), 'manually-set');
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-confirm'));
|
await user.click(screen.getByTestId('offering-slug-confirm'));
|
||||||
|
|
||||||
await userEvent.clear(screen.getByTestId('offering-title'));
|
await user.clear(screen.getByTestId('offering-title'));
|
||||||
await userEvent.type(screen.getByTestId('offering-title'), 'Compleet Andere Titel');
|
await user.type(screen.getByTestId('offering-title'), 'Compleet Andere Titel');
|
||||||
|
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('manually-set');
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('manually-set');
|
||||||
});
|
});
|
||||||
@@ -115,10 +120,10 @@ describe('OfferingFormPage', () => {
|
|||||||
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
||||||
|
|
||||||
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-edit'));
|
await user.click(screen.getByTestId('offering-slug-edit'));
|
||||||
await userEvent.clear(screen.getByTestId('offering-slug'));
|
await user.clear(screen.getByTestId('offering-slug'));
|
||||||
await userEvent.type(screen.getByTestId('offering-slug'), 'something-else');
|
await user.type(screen.getByTestId('offering-slug'), 'something-else');
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-cancel'));
|
await user.click(screen.getByTestId('offering-slug-cancel'));
|
||||||
|
|
||||||
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('starter');
|
expect(screen.getByTestId('offering-slug-display')).toHaveTextContent('starter');
|
||||||
});
|
});
|
||||||
@@ -128,12 +133,12 @@ describe('OfferingFormPage', () => {
|
|||||||
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
renderApp('/offerings/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/edit');
|
||||||
|
|
||||||
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
await screen.findByTestId('offering-title', {}, { timeout: 10000 });
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-edit'));
|
await user.click(screen.getByTestId('offering-slug-edit'));
|
||||||
await userEvent.clear(screen.getByTestId('offering-slug'));
|
await user.clear(screen.getByTestId('offering-slug'));
|
||||||
await userEvent.type(screen.getByTestId('offering-slug'), 'pro');
|
await user.type(screen.getByTestId('offering-slug'), 'pro');
|
||||||
await userEvent.click(screen.getByTestId('offering-slug-confirm'));
|
await user.click(screen.getByTestId('offering-slug-confirm'));
|
||||||
|
|
||||||
await userEvent.click(screen.getByTestId('offering-form-submit'));
|
await user.click(screen.getByTestId('offering-form-submit'));
|
||||||
|
|
||||||
expect(await screen.findByText(/pro.*al in gebruik|already.*taken/i)).toBeInTheDocument();
|
expect(await screen.findByText(/pro.*al in gebruik|already.*taken/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user