From aac4a171ba1974d2ce39c0ea634c29199d7aab67 Mon Sep 17 00:00:00 2001 From: Parag More Date: Mon, 7 Sep 2026 17:46:46 +0530 Subject: [PATCH] test(async): QA harness for async tag loading with the install snippet's stub The tag source moved to surface_forms (packages/surface-scripts, SURF-1936); the async stub-queue drain ships from there (surface_forms#5844) and reaches this repo through the publish workflow. This keeps the manual QA harness here with the rest of test/: async-stub.html loads the tag async with the install snippet's stub, constructs slideover/popup/inline/input-trigger embeds (plus prefillData and an early SurfaceSetConsent) before the tag arrives, and covers slow-tag (?tagDelay=) and blocked-tag (?noTag=1) scenarios with a live status panel. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_013Kjq1CG5RwFMpeucoPJWML --- test/async-stub.html | 206 +++++++++++++++++++++++++++++++++++++++++++ test/index.html | 5 ++ 2 files changed, 211 insertions(+) create mode 100644 test/async-stub.html diff --git a/test/async-stub.html b/test/async-stub.html new file mode 100644 index 0000000..ca583e1 --- /dev/null +++ b/test/async-stub.html @@ -0,0 +1,206 @@ + + + + + + + Async Stub QA - Surface Form + + + + + + + + + +
+

Async Stub QA

+

← Back to Test Suite

+ +
+ What this page verifies: every embed below is constructed + before the async tag loads — the stub queues the calls and the tag + replays them on arrival. Covers embedding (slideover / popup / inline), + pre-filling, the email input trigger, pre-loading, and an early + SurfaceSetConsent call.

+ Scenarios: ?tagDelay=3000 (slow tag on a fast site), + ?tagDelay=8000 (interact before the tag exists), + ?noTag=1 (tag never loads — page must stay functional, + forms simply don't open). +
+ Form Source:
+ Environment ID:
+ Debug Mode: false (add &surfaceDebug=true to enable) +
+ +

Stub status

+
+

Tag script: not injected yet

+

Calls queued before tag load: ?

+

Tag drained the queue: waiting…

+

Stub references re-pointed at real embeds: waiting…

+

Surface iframes in DOM (watch pre-loading kick in after page load): 0

+

Embeds after drain:

+
+ +

Events Summary

+
+
0
Total Events
+
0
Sent to Iframe
+
0
Received from Iframe
+
0
STORE_UPDATE
+
0
LEAD_DATA_UPDATE
+
0
SEND_DATA
+
+ +

Events Log

+
+ + +
+
+ +
+

1. Slideover embedding

+

Constructed pre-load. With ?tagDelay=8000: the trigger button is + inert until the tag arrives (expected — no handler exists yet), but the kept + stub reference queues the call and the slideover opens right after the drain.

+
+ + +
+
+ +
+

2. Popup embedding + pre-filling

+

Constructed pre-load with prefillData. Open it and check the + pre-filled answer; the STORE_UPDATE payload in the log carries it as + questionIds. Override with + ?prefillQid=<questionId>&prefillVal=<value> + to target a real question on your form.

+
+ +
+
+ +
+

3. Email input trigger

+

Constructed pre-load as an input-trigger embed. Enter an email + and submit — the form opens with the email pre-filled.

+
+
+ + + +
+
+
+ +
+

4. Inline embedding

+

Constructed pre-load. The form must appear below on its own once the tag + drains the queue — no interaction needed.

+
+
+ +
+

5. Pre-loading

+

All embeds above use the default preload: "true" (page load + + idle). Without clicking anything, the iframe count in the status panel + should rise shortly after the tag loads — that is pre-loading working + through the async path.

+
+
+ + + + + + diff --git a/test/index.html b/test/index.html index 1a64fca..faaa5f9 100644 --- a/test/index.html +++ b/test/index.html @@ -56,6 +56,11 @@

5. Direct Iframe

Customer-embedded iframe with a slow (?tagDelay=3000) or blocked (?noTag=1) tag.

Test Direct Iframe → +