Corporate Pool (A) — initial

SPA Navigation + Dynamic Content Test

This page exercises Plan 68c Phase S5 hooks: URL-change handler (history.pushState / popstate / hashchange) and the MutationObserver on dynamically rendered phone numbers.

Sanity check — static phone on initial load

Call our main line: (555) 123-4567

This should already be swapped to the Corporate pool's tracking number on page load.

Test 1 — MutationObserver fires on dynamic insertion

Click the button to inject new content with a phone number below. The phone number in the injected content should be swapped within 50–100ms (debounced MutationObserver tick).

(Click button to inject content here)
(Click button to inject tel: link here)

Test 2 — SPA navigation via history.pushState

These buttons change the URL without a full page reload. The phone module's URL-change handler should:
1. Reset its swap dedupe state
2. Re-evaluate the 5 gates against the new URL
3. Trigger a fresh swap if the new pool's tracking number is in cache (or a fetch if not).

After clicking, this page's content stays the same (we don't actually swap content; this just mimics a SPA route change). Inspect the DOM — the phone module should re-fire its swap logic because the URL changed. Use the inject buttons above AFTER navigating to verify the observer is still attached.

Test 3 — hashchange event

Click to change the URL hash. The URL-change handler also listens for hashchange, so this should fire the same re-evaluate path.

Test 4 — Idempotency under repeated mutations

Click 5 times rapidly. The injected phone number should be swapped once; subsequent injections of the same wrapped span should not be re-processed.

(Multiple numbers will be injected here)