-
Notifications
You must be signed in to change notification settings - Fork 0
fix(public): verify the shared footer copy in the live deploy acceptance #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5c99578
359b99c
0e4332d
ab7f4fb
624c8d1
e30dace
63730a6
ccb83d5
35fd0a8
21412ed
147df80
90111bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,6 +183,69 @@ try { | |
| } | ||
| } | ||
| } | ||
| console.log("H. shared-footer pages carry visitor-facing footer copy, not launch-prep (PR #35)") | ||
| { | ||
| // Same coverage and markers as scripts/test-public-footer-copy.mjs: every | ||
| // live path that carries the shared footer block must name the actual | ||
| // products and must not contain any fragment of the launch-prep footer | ||
| // line the June-20 bundle still serves. | ||
| const FOOTER_PATHS = [ | ||
| "/contact/", | ||
| "/drishti/", | ||
| "/drishti/privacy/", | ||
| "/drishti/support/", | ||
| "/privacy-choices/", | ||
| "/privacy/", | ||
| "/promptly/", | ||
| "/promptly/privacy/", | ||
| "/promptly/support/", | ||
| "/support/", | ||
| "/terms/", | ||
| ] | ||
| const LAUNCH_PREP_FRAGMENTS = [ | ||
| "clean public foundation", | ||
| "foundation before launch", | ||
| "gives each product", | ||
| "before launch", | ||
| ] | ||
| const VISITOR_FACING_FRAGMENTS = ["Promptly", "Drishti"] | ||
|
|
||
| const footerBlockOf = (html) => { | ||
| const start = html.indexOf("<footer") | ||
| const end = html.indexOf("</footer>") | ||
| return start >= 0 && end > start ? html.slice(start, end) : "" | ||
| } | ||
|
|
||
| const checkFooter = (label, html) => { | ||
| const footer = footerBlockOf(html) | ||
| ok(footer.length > 0, `${label} has a footer block`) | ||
| const copyBlock = footer.match(/<p class="footer-copy"[^>]*>([\s\S]*?)<\/p>/) | ||
| ok(copyBlock !== null, `${label} has a .footer-copy paragraph`) | ||
| if (copyBlock) { | ||
| const copy = copyBlock[1] | ||
| for (const fragment of VISITOR_FACING_FRAGMENTS) { | ||
| ok(copy.includes(fragment), `${label} footer copy names ${fragment}`) | ||
| } | ||
| for (const fragment of LAUNCH_PREP_FRAGMENTS) { | ||
| ok(!copy.includes(fragment), `${label} footer copy avoids "${fragment}"`) | ||
|
Comment on lines
+229
to
+230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If a deployed footer contains a capitalization variant such as Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| for (const fragment of LAUNCH_PREP_FRAGMENTS) { | ||
| ok(!footer.includes(fragment), `${label} footer has no "${fragment}"`) | ||
| } | ||
| } | ||
|
|
||
| for (const path of FOOTER_PATHS) { | ||
| const { status, body } = await get(path) | ||
| ok(status === 200, `${path} returns 200 (got ${status})`) | ||
| checkFooter(path, body) | ||
| } | ||
| const footerProbe = `/definitely-missing-footer-probe-${Date.now()}` | ||
| const { status, body } = await get(footerProbe) | ||
| ok(status === 404, `unknown URL returns 404 for footer probe (got ${status})`) | ||
| checkFooter("404 page", body) | ||
| } | ||
|
|
||
| } catch (error) { | ||
| failures++ | ||
| console.error(` FAIL live request error: ${error.message}`) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a shared footer remains semantically unchanged but its attributes are reordered, use single quotes, or add another class (for example,
<p style="..." class="footer-copy">), this regex fails to recognize the paragraph and blocks the post-deploy release lane. Match the class attribute regardless of attribute order and quoting, or parse the footer as HTML, so valid markup refactors do not produce a false deployment failure.Useful? React with 👍 / 👎.