Skip to content

Commit de4f8c1

Browse files
committed
chore: release prep for v1.17.0
1 parent d84423f commit de4f8c1

File tree

8 files changed

+137
-44
lines changed

8 files changed

+137
-44
lines changed

.github/workflows/meta-check.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# .github/workflows/meta-check.yml
2+
#
3+
# Copyright © 2025 Network Pro Strategies (Network Pro™)
4+
# SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5+
# This file is part of Network Pro
6+
7+
name: Metadata Check
8+
9+
on:
10+
push:
11+
branches: [master]
12+
pull_request:
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
meta:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repo
23+
uses: actions/checkout@v5
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v5
27+
with:
28+
node-version: 24
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Run meta tests
34+
run: npx vitest run tests/meta/meta.test.js --reporter=verbose

.github/workflows/playwright.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212
branches: [master]
1313
workflow_dispatch:
1414

15-
# ✅ Least-privilege access
15+
# Required for actions/checkout
1616
permissions:
17-
contents: read # Required for actions/checkout
17+
contents: read
1818

1919
jobs:
2020
test:

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,20 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
3535
- Documented use of both `report-uri` (legacy) and `report-to` (modern, recommended).
3636
- Added example headers including `Report-To` definition.
3737

38+
### Added
39+
40+
- New `meta-check.yml` GitHub Actions workflow to validate `<title>` and `<meta>` descriptions using Vitest.
41+
- Runs separately from Playwright to avoid hydration timing issues.
42+
- Ensures SEO metadata is tested in CI without blocking other jobs.
43+
- New `meta.test.js` file in `tests/unit/meta` for testing in CI.
44+
- New `meta.test.js` file in `tests/unit/server` for local testing.
45+
3846
### Changed
3947

48+
- Cleaned up Playwright E2E tests:
49+
- Removed brittle `toHaveTitle` assertions causing CI failures.
50+
- Standardized footer checks to use helper function.
51+
- Improved test readability and consistency in `app.spec.js` and `mobile.spec.js`.
4052
- Updated generator metadata in `app.html` to reflect `SvelteKit 2.42.1`.
4153
- Updated Node.js version in `.node-version` and `.nvmrc` to `24.8.0`.
4254
- Updated CSP endpoint section and footer in `README.md`.
@@ -71,8 +83,8 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
7183

7284
### Removed
7385

74-
- Deleted `src/routes/example.svx`, which was unused and unneeded
75-
- Removed `mdsvex` from package.json, as it is unlikely to be used
86+
- Deleted `src/routes/example.svx`, which was unused and unneeded.
87+
- Removed `mdsvex` from package.json, as it is unlikely to be used.
7688

7789
### Notes
7890

tests/e2e/app.spec.js

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This file is part of Network Pro.
1111
* @description Runs Playwright E2E tests with desktop and root route assertions.
1212
* @module tests/e2e
1313
* @author SunDevil311
14-
* @updated 2025-05-29
14+
* @updated 2025-09-17
1515
*/
1616

1717
import { expect, test } from '@playwright/test';
@@ -22,28 +22,14 @@ import {
2222
setMobileView,
2323
} from './shared/helpers.js';
2424

25-
// Root route should load successfully with the correct title
25+
// Root route should display nav bar and about link
2626
test.describe('Desktop Tests', () => {
27-
test('should load successfully with the correct title', async ({
28-
page,
29-
browserName,
30-
}) => {
31-
if (browserName === 'webkit') test.skip();
32-
33-
await setDesktopView(page);
34-
await page.goto('/');
35-
await page.waitForLoadState('load', { timeout: 60000 });
36-
await expect(page).toHaveTitle(/Security, Networking, Privacy/, {
37-
timeout: 60000,
38-
});
39-
});
40-
41-
// Root route should display nav bar and about link
4227
test("should display the navigation bar and 'about' link", async ({
4328
page,
4429
}) => {
4530
await setDesktopView(page);
4631
await page.goto('/');
32+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
4733

4834
const nav = await getVisibleNav(page);
4935

@@ -56,8 +42,9 @@ test.describe('Desktop Tests', () => {
5642
test('should display the footer correctly', async ({ page }) => {
5743
await setDesktopView(page);
5844
await page.goto('/');
45+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
5946

60-
const footer = page.locator('footer');
47+
const footer = getFooter(page);
6148
await expect(footer).toBeVisible();
6249
});
6350

@@ -67,6 +54,7 @@ test.describe('Desktop Tests', () => {
6754
}) => {
6855
await setDesktopView(page);
6956
await page.goto('/about');
57+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
7058

7159
const footer = getFooter(page);
7260
await expect(footer).toBeVisible();
@@ -76,40 +64,29 @@ test.describe('Desktop Tests', () => {
7664
test("should ensure the 'about' link is clickable", async ({ page }) => {
7765
await setDesktopView(page);
7866
await page.goto('/');
67+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
7968

8069
const nav = await getVisibleNav(page);
8170

8271
const aboutLink = nav.getByRole('link', { name: 'about' });
83-
await expect(aboutLink).toBeVisible({ timeout: 60000 });
72+
await expect(aboutLink).toBeVisible();
8473
await aboutLink.click();
8574

8675
await page.waitForURL('/about', { timeout: 60000 });
8776
await expect(page).toHaveURL(/\/about/);
8877
});
8978
}); // End Desktop Tests
9079

91-
// Root route should load successfully with the correct title (mobile)
80+
// Root route should display headings properly on mobile
9281
test.describe('Mobile Tests', () => {
93-
test('should load successfully with the correct title on mobile', async ({
94-
page,
95-
browserName,
96-
}) => {
97-
if (browserName === 'webkit') test.skip();
98-
99-
await setMobileView(page);
100-
await page.goto('/');
101-
await page.waitForLoadState('load', { timeout: 60000 });
102-
await expect(page).toHaveTitle(/Security, Networking, Privacy/, {
103-
timeout: 60000,
104-
});
105-
});
106-
107-
// Root route should display headings properly on mobile
10882
test('should display main content correctly on mobile', async ({ page }) => {
10983
await setMobileView(page);
11084
await page.goto('/');
85+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
11186

11287
const mainHeading = page.locator('h1, h2');
11388
await expect(mainHeading).toBeVisible();
11489
});
11590
});
91+
92+
// cspell:ignore domcontentloaded

tests/e2e/mobile.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This file is part of Network Pro.
1111
* @description Runs Playwright E2E tests with mobile assertions.
1212
* @module tests/e2e
1313
* @author SunDevil311
14-
* @updated 2025-05-29
14+
* @updated 2025-09-17
1515
*/
1616

1717
import { expect, test } from '@playwright/test';
@@ -60,10 +60,10 @@ test.describe('Mobile Tests', () => {
6060

6161
const nav = await getVisibleNav(page);
6262
const aboutLink = nav.getByRole('link', { name: 'about' });
63-
await expect(aboutLink).toBeVisible({ timeout: 60000 });
63+
await expect(aboutLink).toBeVisible();
6464

6565
await aboutLink.click();
66-
await expect(page).toHaveURL(/\/about/);
66+
await expect(page).toHaveURL(/\/about/, { timeout: 60000 });
6767
});
6868

6969
test('should display the footer on /about (mobile)', async ({

tests/unit/meta/meta.test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* ==========================================================================
2+
tests/unit/meta/meta.test.js
3+
4+
Copyright © 2025 Network Pro Strategies (Network Pro™)
5+
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
6+
This file is part of Network Pro.
7+
========================================================================== */
8+
9+
/**
10+
* @file meta.test.js
11+
* @description Checks for correct metadata population in CI
12+
* @module tests/unit/meta
13+
* @author SunDevil311
14+
* @updated 2025-09-17
15+
*/
16+
17+
import { describe, expect, it } from 'vitest';
18+
import { load } from '../../../src/routes/+layout.js';
19+
20+
const routes = [
21+
{
22+
path: '/',
23+
title: /Security, Networking, Privacy/,
24+
description: /Network Pro/,
25+
},
26+
// add more paths as needed:
27+
// { path: '/about', title: /About/, description: /Network Pro/ }
28+
];
29+
30+
describe('Meta checks', () => {
31+
for (const route of routes) {
32+
it(`should return correct meta for ${route.path}`, () => {
33+
const mockUrl = new URL(`http://localhost${route.path}`);
34+
const { meta } = load({ url: mockUrl });
35+
36+
expect(meta.title).toMatch(route.title);
37+
expect(meta.description).toMatch(route.description);
38+
});
39+
}
40+
});

tests/unit/server/internal/auditCoverage.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ This file is part of Network Pro.
1010
* @file auditCoverage.test.js
1111
* @description Scans all .js files in src/ and scripts/ for matching unit
1212
* tests
13-
* @module tests/internal
13+
* @module tests/unit/server/internal
1414
* @author SunDevil311
15-
* @updated 2025-07-01
15+
* @updated 2025-09-17
1616
*/
1717

1818
import fs from 'fs';

tests/unit/server/meta.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* ==========================================================================
2+
tests/unit/server/meta.test.js
3+
4+
Copyright © 2025 Network Pro Strategies (Network Pro™)
5+
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
6+
This file is part of Network Pro.
7+
========================================================================== */
8+
9+
/**
10+
* @file meta.test.js
11+
* @description Checks for correct metadata population
12+
* @module tests/unit/server
13+
* @author SunDevil311
14+
* @updated 2025-09-17
15+
*/
16+
17+
import { describe, expect, it } from 'vitest';
18+
import { load } from '../../../src/routes/+layout.js'; // adjust path if needed
19+
20+
describe('Meta info', () => {
21+
it('should have correct title and description', () => {
22+
// Mock a URL similar to what SvelteKit provides
23+
const mockUrl = new URL('http://localhost/');
24+
25+
const { meta } = load({ url: mockUrl });
26+
27+
expect(meta.title).toMatch(/Security, Networking, Privacy/);
28+
expect(meta.description).toMatch(/Network Pro/);
29+
});
30+
});

0 commit comments

Comments
 (0)