@networkpro/web 1.15.4 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-and-publish.yml +19 -12
- package/.github/workflows/lighthouse.yml +1 -1
- package/.github/workflows/meta-check.yml +34 -0
- package/.github/workflows/playwright.yml +3 -3
- package/.github/workflows/publish-test.yml +3 -3
- package/.github/workflows/templates/publish.template.yml +3 -3
- package/.node-version +1 -1
- package/.nvmrc +1 -1
- package/.svelte-kit/tsconfig.json +3 -0
- package/CHANGELOG.md +120 -1
- package/CODE_OF_CONDUCT.md +173 -0
- package/CONTRIBUTING.md +214 -0
- package/LICENSE.md +3 -3
- package/README.md +21 -9
- package/package.json +24 -25
- package/playwright.config.js +2 -2
- package/src/app.html +2 -2
- package/src/lib/components/Badges.svelte +2 -1
- package/src/lib/components/Logo.svelte +6 -5
- package/src/lib/components/layout/Footer.svelte +4 -18
- package/src/lib/pages/LicenseContent.svelte +6 -16
- package/src/lib/styles/css/default.css +12 -0
- package/src/lib/styles/css/style.css +5 -3
- package/src/lib/styles/global.min.css +1 -1
- package/src/routes/consultation/+page.svelte +1 -1
- package/src/routes/pgp/[key]/+server.js +1 -1
- package/stylelint.config.js +6 -0
- package/tests/e2e/app.spec.js +12 -31
- package/tests/e2e/mobile.spec.js +3 -3
- package/tests/meta/meta.test.js +40 -0
- package/tests/unit/server/internal/auditCoverage.test.js +2 -2
- package/tests/unit/server/meta.test.js +30 -0
- package/src/routes/example.svx +0 -9
package/stylelint.config.js
CHANGED
|
@@ -56,6 +56,12 @@ export default {
|
|
|
56
56
|
"Class names must not start with 'fa-' (FontAwesome classes are ignored)",
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
|
+
// Disable unnecessarily strict rules
|
|
60
|
+
//'media-type-no-deprecated': null,
|
|
61
|
+
//'property-no-deprecated': null,
|
|
62
|
+
//'nesting-selector-no-missing-scoping-root': null,
|
|
63
|
+
//'no-invalid-position-at-import-rule': null,
|
|
64
|
+
//'no-invalid-position-declaration': null,
|
|
59
65
|
'order/properties-order': [
|
|
60
66
|
[
|
|
61
67
|
{
|
package/tests/e2e/app.spec.js
CHANGED
|
@@ -11,7 +11,7 @@ This file is part of Network Pro.
|
|
|
11
11
|
* @description Runs Playwright E2E tests with desktop and root route assertions.
|
|
12
12
|
* @module tests/e2e
|
|
13
13
|
* @author SunDevil311
|
|
14
|
-
* @updated 2025-
|
|
14
|
+
* @updated 2025-09-17
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { expect, test } from '@playwright/test';
|
|
@@ -22,26 +22,14 @@ import {
|
|
|
22
22
|
setMobileView,
|
|
23
23
|
} from './shared/helpers.js';
|
|
24
24
|
|
|
25
|
-
// Root route should
|
|
25
|
+
// Root route should display nav bar and about link
|
|
26
26
|
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
|
-
});
|
|
38
|
-
|
|
39
|
-
// Root route should display nav bar and about link
|
|
40
27
|
test("should display the navigation bar and 'about' link", async ({
|
|
41
28
|
page,
|
|
42
29
|
}) => {
|
|
43
30
|
await setDesktopView(page);
|
|
44
31
|
await page.goto('/');
|
|
32
|
+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
|
|
45
33
|
|
|
46
34
|
const nav = await getVisibleNav(page);
|
|
47
35
|
|
|
@@ -54,8 +42,9 @@ test.describe('Desktop Tests', () => {
|
|
|
54
42
|
test('should display the footer correctly', async ({ page }) => {
|
|
55
43
|
await setDesktopView(page);
|
|
56
44
|
await page.goto('/');
|
|
45
|
+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
|
|
57
46
|
|
|
58
|
-
const footer = page
|
|
47
|
+
const footer = getFooter(page);
|
|
59
48
|
await expect(footer).toBeVisible();
|
|
60
49
|
});
|
|
61
50
|
|
|
@@ -65,6 +54,7 @@ test.describe('Desktop Tests', () => {
|
|
|
65
54
|
}) => {
|
|
66
55
|
await setDesktopView(page);
|
|
67
56
|
await page.goto('/about');
|
|
57
|
+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
|
|
68
58
|
|
|
69
59
|
const footer = getFooter(page);
|
|
70
60
|
await expect(footer).toBeVisible();
|
|
@@ -74,11 +64,12 @@ test.describe('Desktop Tests', () => {
|
|
|
74
64
|
test("should ensure the 'about' link is clickable", async ({ page }) => {
|
|
75
65
|
await setDesktopView(page);
|
|
76
66
|
await page.goto('/');
|
|
67
|
+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
|
|
77
68
|
|
|
78
69
|
const nav = await getVisibleNav(page);
|
|
79
70
|
|
|
80
71
|
const aboutLink = nav.getByRole('link', { name: 'about' });
|
|
81
|
-
await expect(aboutLink).toBeVisible(
|
|
72
|
+
await expect(aboutLink).toBeVisible();
|
|
82
73
|
await aboutLink.click();
|
|
83
74
|
|
|
84
75
|
await page.waitForURL('/about', { timeout: 60000 });
|
|
@@ -86,26 +77,16 @@ test.describe('Desktop Tests', () => {
|
|
|
86
77
|
});
|
|
87
78
|
}); // End Desktop Tests
|
|
88
79
|
|
|
89
|
-
// Root route should
|
|
80
|
+
// Root route should display headings properly on mobile
|
|
90
81
|
test.describe('Mobile Tests', () => {
|
|
91
|
-
test('should load successfully with the correct title on mobile', async ({
|
|
92
|
-
page,
|
|
93
|
-
browserName,
|
|
94
|
-
}) => {
|
|
95
|
-
if (browserName === 'webkit') test.skip();
|
|
96
|
-
|
|
97
|
-
await setMobileView(page);
|
|
98
|
-
await page.goto('/');
|
|
99
|
-
await page.waitForLoadState('load', { timeout: 60000 });
|
|
100
|
-
await expect(page).toHaveTitle(/Security, Networking, Privacy/);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// Root route should display headings properly on mobile
|
|
104
82
|
test('should display main content correctly on mobile', async ({ page }) => {
|
|
105
83
|
await setMobileView(page);
|
|
106
84
|
await page.goto('/');
|
|
85
|
+
await page.waitForLoadState('domcontentloaded', { timeout: 60000 });
|
|
107
86
|
|
|
108
87
|
const mainHeading = page.locator('h1, h2');
|
|
109
88
|
await expect(mainHeading).toBeVisible();
|
|
110
89
|
});
|
|
111
90
|
});
|
|
91
|
+
|
|
92
|
+
// cspell:ignore domcontentloaded
|
package/tests/e2e/mobile.spec.js
CHANGED
|
@@ -11,7 +11,7 @@ This file is part of Network Pro.
|
|
|
11
11
|
* @description Runs Playwright E2E tests with mobile assertions.
|
|
12
12
|
* @module tests/e2e
|
|
13
13
|
* @author SunDevil311
|
|
14
|
-
* @updated 2025-
|
|
14
|
+
* @updated 2025-09-17
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { expect, test } from '@playwright/test';
|
|
@@ -60,10 +60,10 @@ test.describe('Mobile Tests', () => {
|
|
|
60
60
|
|
|
61
61
|
const nav = await getVisibleNav(page);
|
|
62
62
|
const aboutLink = nav.getByRole('link', { name: 'about' });
|
|
63
|
-
await expect(aboutLink).toBeVisible(
|
|
63
|
+
await expect(aboutLink).toBeVisible();
|
|
64
64
|
|
|
65
65
|
await aboutLink.click();
|
|
66
|
-
await expect(page).toHaveURL(/\/about
|
|
66
|
+
await expect(page).toHaveURL(/\/about/, { timeout: 60000 });
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('should display the footer on /about (mobile)', async ({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
tests/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/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
|
+
});
|
|
@@ -10,9 +10,9 @@ This file is part of Network Pro.
|
|
|
10
10
|
* @file auditCoverage.test.js
|
|
11
11
|
* @description Scans all .js files in src/ and scripts/ for matching unit
|
|
12
12
|
* tests
|
|
13
|
-
* @module tests/internal
|
|
13
|
+
* @module tests/unit/server/internal
|
|
14
14
|
* @author SunDevil311
|
|
15
|
-
* @updated 2025-
|
|
15
|
+
* @updated 2025-09-17
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import fs from 'fs';
|
|
@@ -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';
|
|
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
|
+
});
|