also looking at this
LSU's own coaching surface, and what auditing the site turned up
#12
86 files
+3943
-1190
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2,6 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'bun:test' | ||
| 2 | 2 | import { resolve } from 'node:path' |
| 3 | 3 | import { processDirectives } from '@stacksjs/stx' |
| 4 | 4 | import { coachingModules } from '../resources/data/coaching' |
| 5 | import { absolute } from '../resources/data/site' | |
| 5 | 6 | import { coachingOrigin, forgetBrand } from '../resources/functions/coaching-source' |
| 6 | 7 | |
| 7 | 8 | /** |
| @@ -54,7 +55,7 @@ describe('a module route, with a brand published', () => { | ||
| 54 | 55 | |
| 55 | 56 | expect(html).toContain(`<title>${module.title} - Last Soul Ultra coaching</title>`) |
| 56 | 57 | expect(html).toContain(`content="${module.summary}"`) |
| 57 | expect(html).toContain(`rel="canonical" href="https://lastsoulultra.com/coaching/${module.slug}"`) | |
| 58 | expect(html).toContain(`rel="canonical" href="${absolute(`/coaching/${module.slug}`)}"`) | |
| 58 | 59 | } |
| 59 | 60 | }) |
| 60 | 61 | |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import { describe, expect, it } from 'bun:test' |
| 2 | 2 | import { resolve } from 'node:path' |
| 3 | 3 | import { processDirectives } from '@stacksjs/stx' |
| 4 | import { absolute } from '../resources/data/site' | |
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * /contact and /faq are the same page under two published URLs. They used to |
| @@ -41,7 +42,10 @@ describe('the questions page', () => { | ||
| 41 | 42 | }) |
| 42 | 43 | |
| 43 | 44 | it('canonicalises both to /contact', async () => { |
| 45 | // Built from APP_URL rather than written out: CI materialises a .env from | |
| 46 | // .env.example, where APP_URL is stacks.localhost, so a hard-coded | |
| 47 | // production origin passes on a laptop and fails on a runner. | |
| 44 | 48 | for (const view of ['contact', 'faq']) |
| 45 | expect(await render(view)).toContain('rel="canonical" href="https://lastsoulultra.com/contact"') | |
| 49 | expect(await render(view)).toContain(`rel="canonical" href="${absolute('/contact')}"`) | |
| 46 | 50 | }) |
| 47 | 51 | }) |