Menu

Test an enquiry-off preview with several independent assertions
📰

Test an enquiry-off preview with several independent assertions

DEV Community: typescript·The Doctor·about 16 hours ago
#yBNF4oDV
#devtotypescript#devto#dev#disabled#flow
Long article (375 words) — no AI summary yet.
Reading 0:00
15s threshold

The gutter replacement planner can show gutters and downpipes in a user brief while enquiries remain closed. A single screenshot of a greyed-out button tells you little about whether the disabled workflow still holds across keyboard navigation, alternative entry points and future template changes.

Assert structure before interacting

The Astro component renders an actual disabled fieldset for contact details. The site build also checks the generated page for a closed-flow marker and absence of a native form or API target. This covers HTML before client code runs. That matters because a CSS class is only visual and a disabled workflow should work the same way after a build.

const flow = page . locator ( '.project-flow' ) ; await expect ( flow ) . toHaveAttribute ( 'data-enabled' , 'false' ) ; await expect ( flow . locator ( 'form' ) ) . toHaveCount ( 0 ) ; // After completing the planner questions and postcode: await expect ( flow . getByLabel ( 'Email address' , { exact : true } ) ) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.