@networkpro/web 1.6.5 → 1.7.2
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/CODE_OF_CONDUCT.md +2 -2
- package/LICENSE.md +20 -9
- package/README.md +57 -13
- package/_redirects +1 -0
- package/cspell.json +2 -0
- package/package.json +7 -7
- package/playwright.config.js +1 -0
- package/src/lib/components/FullWidthSection.svelte +19 -4
- package/src/lib/components/LegalNav.svelte +31 -29
- package/src/lib/components/PostHog.svelte +20 -8
- package/src/lib/components/layout/Footer.svelte +1 -1
- package/src/lib/components/layout/HeaderDefault.svelte +2 -2
- package/src/lib/components/layout/HeaderHome.svelte +2 -2
- package/src/lib/images.js +3 -2
- package/src/lib/index.js +2 -1
- package/src/lib/meta.js +6 -1
- package/src/lib/pages/LicenseContent.svelte +17 -17
- package/src/lib/pages/PrivacyContent.svelte +116 -6
- package/src/lib/pages/PrivacyDashboard.svelte +240 -0
- package/src/lib/pages/TermsUseContent.svelte +1 -1
- package/src/lib/styles/css/default.css +23 -10
- package/src/lib/styles/global.min.css +1 -3
- package/src/lib/utils/privacy.js +18 -3
- package/src/lib/utils/trackingCookies.js +40 -0
- package/src/lib/utils/trackingStatus.js +46 -0
- package/src/lib/utils/utm.js +8 -1
- package/src/routes/about/+page.svelte +1 -7
- package/src/routes/foss-spotlight/+page.svelte +1 -7
- package/src/routes/license/+page.svelte +2 -8
- package/src/routes/privacy/+page.server.js +18 -0
- package/src/routes/{privacy-policy → privacy}/+page.svelte +5 -11
- package/src/routes/{privacy-policy → privacy-dashboard}/+page.server.js +2 -2
- package/src/routes/privacy-dashboard/+page.svelte +69 -0
- package/src/routes/terms-conditions/+page.svelte +2 -8
- package/src/routes/terms-of-use/+page.svelte +2 -8
- package/src/service-worker.js +31 -6
- package/static/robots.txt +2 -1
- package/static/sitemap.xml +10 -22
- package/tests/e2e/app.spec.js +50 -68
- package/tests/e2e/mobile.spec.js +32 -42
- package/tests/e2e/shared/helpers.js +57 -0
package/tests/e2e/mobile.spec.js
CHANGED
|
@@ -6,33 +6,29 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================== */
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @file mobile.spec.js
|
|
11
|
+
* @description Runs Playwright E2E tests with mobile assertions.
|
|
12
|
+
* @module tests/e2e
|
|
13
|
+
* @author SunDevil311
|
|
14
|
+
* @updated 2025-05-29
|
|
15
|
+
*/
|
|
16
|
+
|
|
9
17
|
import { expect, test } from "@playwright/test";
|
|
18
|
+
import { getFooter, getVisibleNav, setMobileView } from "./shared/helpers.js";
|
|
10
19
|
|
|
20
|
+
// Mobile viewport smoke tests for the root route
|
|
11
21
|
test.describe("Mobile Tests", () => {
|
|
12
|
-
// Skip WebKit for mobile tests if it's problematic
|
|
13
22
|
test("should display the main description text on mobile", async ({
|
|
14
23
|
page,
|
|
15
24
|
browserName,
|
|
16
25
|
}) => {
|
|
17
|
-
if (browserName === "webkit")
|
|
18
|
-
test.skip(); // Skip WebKit if it's problematic
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
await page.setViewportSize({ width: 375, height: 667 }); // Mobile size (e.g., iPhone 6)
|
|
22
|
-
|
|
23
|
-
// Add a small timeout before navigating to the page
|
|
24
|
-
await page.waitForTimeout(1500); // Wait for 1.5 seconds
|
|
26
|
+
if (browserName === "webkit") test.skip();
|
|
25
27
|
|
|
28
|
+
await setMobileView(page);
|
|
26
29
|
await page.goto("/");
|
|
27
|
-
|
|
28
|
-
// Wait for the page to load and for the title element to be available
|
|
29
30
|
await page.waitForLoadState("domcontentloaded", { timeout: 60000 });
|
|
30
|
-
await page.waitForSelector(
|
|
31
|
-
'div.index-title1:has-text("Locking Down Networks")',
|
|
32
|
-
{ timeout: 60000 },
|
|
33
|
-
);
|
|
34
31
|
|
|
35
|
-
// Assert that the correct text is found inside the <div>
|
|
36
32
|
const description = page.locator(
|
|
37
33
|
'div.index-title1:has-text("Locking Down Networks")',
|
|
38
34
|
);
|
|
@@ -43,21 +39,12 @@ test.describe("Mobile Tests", () => {
|
|
|
43
39
|
page,
|
|
44
40
|
browserName,
|
|
45
41
|
}) => {
|
|
46
|
-
if (browserName === "webkit")
|
|
47
|
-
test.skip(); // Skip WebKit if it's problematic
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
await page.setViewportSize({ width: 375, height: 667 }); // Mobile size
|
|
51
|
-
|
|
52
|
-
// Add a small timeout before navigating to the page
|
|
53
|
-
await page.waitForTimeout(1500); // Wait for 1.5 seconds
|
|
42
|
+
if (browserName === "webkit") test.skip();
|
|
54
43
|
|
|
44
|
+
await setMobileView(page);
|
|
55
45
|
await page.goto("/");
|
|
56
|
-
|
|
57
|
-
// Wait for the page to load
|
|
58
46
|
await page.waitForLoadState("domcontentloaded", { timeout: 60000 });
|
|
59
47
|
|
|
60
|
-
// Check that the main heading is visible on mobile
|
|
61
48
|
const mainHeading = page.locator("h1, h2");
|
|
62
49
|
await expect(mainHeading).toBeVisible();
|
|
63
50
|
});
|
|
@@ -66,28 +53,31 @@ test.describe("Mobile Tests", () => {
|
|
|
66
53
|
page,
|
|
67
54
|
browserName,
|
|
68
55
|
}) => {
|
|
69
|
-
if (browserName === "webkit")
|
|
70
|
-
test.skip(); // Skip WebKit if it's problematic
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
await page.setViewportSize({ width: 375, height: 667 }); // Mobile size
|
|
74
|
-
|
|
75
|
-
// Add a small timeout before navigating to the page
|
|
76
|
-
await page.waitForTimeout(1500); // Wait for 1.5 seconds
|
|
56
|
+
if (browserName === "webkit") test.skip();
|
|
77
57
|
|
|
58
|
+
await setMobileView(page);
|
|
78
59
|
await page.goto("/");
|
|
79
60
|
|
|
80
|
-
|
|
81
|
-
|
|
61
|
+
const nav = await getVisibleNav(page);
|
|
62
|
+
const aboutLink = nav.getByRole("link", { name: "about" });
|
|
63
|
+
await expect(aboutLink).toBeVisible({ timeout: 60000 });
|
|
82
64
|
|
|
83
|
-
// Ensure the "about" link is visible and clickable
|
|
84
|
-
const aboutLink = page.locator("a", { hasText: "about" });
|
|
85
|
-
await expect(aboutLink).toBeVisible();
|
|
86
65
|
await aboutLink.click();
|
|
87
|
-
|
|
88
|
-
// Assert that it navigates to the correct route
|
|
89
66
|
await expect(page).toHaveURL(/\/about/);
|
|
90
67
|
});
|
|
68
|
+
|
|
69
|
+
test("should display the footer on /about (mobile)", async ({
|
|
70
|
+
page,
|
|
71
|
+
browserName,
|
|
72
|
+
}) => {
|
|
73
|
+
if (browserName === "webkit") test.skip();
|
|
74
|
+
|
|
75
|
+
await setMobileView(page);
|
|
76
|
+
await page.goto("/about");
|
|
77
|
+
|
|
78
|
+
const footer = getFooter(page);
|
|
79
|
+
await expect(footer).toBeVisible();
|
|
80
|
+
});
|
|
91
81
|
});
|
|
92
82
|
|
|
93
83
|
// cspell:ignore domcontentloaded
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
tests/e2e/shared/helpers.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 helpers.js
|
|
11
|
+
* @description Stores commonly used functions for importing into E2E tests.
|
|
12
|
+
* @module tests/e2e/shared
|
|
13
|
+
* @author SunDevil311
|
|
14
|
+
* @updated 2025-05-29
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {import('@playwright/test').Page} page - The Playwright page object.
|
|
19
|
+
* @returns {Promise<void>}
|
|
20
|
+
* @description Sets standard desktop viewport and waits for animations.
|
|
21
|
+
*/
|
|
22
|
+
export async function setDesktopView(page) {
|
|
23
|
+
await page.setViewportSize({ width: 1280, height: 720 });
|
|
24
|
+
await page.waitForTimeout(1500);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {import('@playwright/test').Page} page
|
|
29
|
+
* @returns {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
export async function setMobileView(page) {
|
|
32
|
+
await page.setViewportSize({ width: 375, height: 667 });
|
|
33
|
+
await page.waitForTimeout(1500);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {import('@playwright/test').Page} page - The Playwright page object.
|
|
38
|
+
* @returns {Promise<import('@playwright/test').Locator>} - A visible navigation locator.
|
|
39
|
+
* @throws {Error} If no visible navigation is found.
|
|
40
|
+
*/
|
|
41
|
+
export async function getVisibleNav(page) {
|
|
42
|
+
const navHome = page.getByRole("navigation", { name: "Homepage navigation" });
|
|
43
|
+
const navMain = page.getByRole("navigation", { name: "Main navigation" });
|
|
44
|
+
|
|
45
|
+
if (await navHome.isVisible()) return navHome;
|
|
46
|
+
if (await navMain.isVisible()) return navMain;
|
|
47
|
+
|
|
48
|
+
throw new Error("No visible navigation element found.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {import('@playwright/test').Page} page
|
|
53
|
+
* @returns {import('@playwright/test').Locator}
|
|
54
|
+
*/
|
|
55
|
+
export function getFooter(page) {
|
|
56
|
+
return page.locator("footer");
|
|
57
|
+
}
|