Turnstile Integration Test

Uses standard Turnstile integration patterns. The mock script is loaded in place of the real api.js via a local redirect.

1. Implicit Rendering

Standard integration: just a div with class and data attributes.

2. Form with Turnstile

Standard form integration. Token goes into hidden input, submitted with form.

3. Explicit Render

Render via turnstile.render() with JS callback.

4. Deferred Execution

Widget renders but does not solve until turnstile.execute() is called.

5. Deferred via Data Attribute

Implicit render with data-execution="execute".

6. Reset & Remove

Test turnstile.reset() and turnstile.remove().

7. Selector Verification

Verify all common Turnstile selectors find the widget.

8. querySelector then render

Find the widget by title selector, then pass it to turnstile.render() (the original use case).

9. Dynamic Widget

Add a .cf-turnstile div dynamically — MutationObserver should pick it up.