From 61ebaca19f87e65b113991550150f0ed8b12a2a7 Mon Sep 17 00:00:00 2001 From: Astrid Gealer Date: Sat, 24 Oct 2026 01:08:20 +0000 Subject: [PATCH] test(frontend): pin the literal Archera signup URL in archera tests Both signup-link tests (education page and offer modal) only compared the href against the imported ARCHERA_SIGNUP_URL constant, so they kept passing if the constant itself drifted to a wrong destination (typo, stray UTM, wrong domain). Each now also asserts the literal canonical URL, https://www.archera.ai/cudly, mirroring the Go-side fix in LeanerCloud/cloud-commitments-cli#1280. The constant-based assertion stays, so the tests still prove the code uses the exported const. Verified by temporarily changing the constant: both tests fail with the pin and passed without it. Refs #49 Co-Authored-By: Claude Opus 5.5 --- frontend/src/__tests__/archera.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/__tests__/archera.test.ts b/frontend/src/__tests__/archera.test.ts index 453ab4091..df99a152a 100644 --- a/frontend/src/__tests__/archera.test.ts +++ b/frontend/src/__tests__/archera.test.ts @@ -162,6 +162,10 @@ describe('openArcheraPage', () => { '#archera-page-container a.archera-signup-btn', ); expect(link).not.toBeNull(); + // Literal pin (issue #49): comparing only against the imported constant + // would pass if ARCHERA_SIGNUP_URL itself drifted to a wrong destination. + expect(link!.href).toBe('https://www.archera.ai/cudly'); + // And the link is built from the exported constant, not a second copy. expect(link!.href).toBe(ARCHERA_SIGNUP_URL); expect(link!.target).toBe('_blank'); expect(link!.rel).toBe('noopener noreferrer'); @@ -243,6 +247,10 @@ describe('openArcheraOfferModal', () => { '#archera-offer-modal-container a.archera-offer-signup', ); expect(link).not.toBeNull(); + // Literal pin (issue #49): comparing only against the imported constant + // would pass if ARCHERA_SIGNUP_URL itself drifted to a wrong destination. + expect(link!.href).toBe('https://www.archera.ai/cudly'); + // And the link is built from the exported constant, not a second copy. expect(link!.href).toBe(ARCHERA_SIGNUP_URL); expect(link!.target).toBe('_blank'); expect(link!.rel).toBe('noopener noreferrer');