@networkpro/web 1.18.5 → 1.20.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 +5 -4
- package/.github/workflows/lighthouse.yml +1 -1
- package/.github/workflows/meta-check.yml +1 -1
- package/.github/workflows/playwright.yml +1 -1
- package/.github/workflows/publish-test.yml +5 -4
- package/.github/workflows/templates/publish.template.yml +5 -4
- package/CHANGELOG.md +116 -1
- package/cspell.json +3 -0
- package/package.json +16 -16
- package/scripts/auditScripts.js +1 -1
- package/scripts/bundleCss.js +1 -1
- package/scripts/checkEnv.js +1 -1
- package/scripts/checkNode.js +1 -1
- package/scripts/checkVersions.js +1 -1
- package/scripts/generateTest.js +1 -1
- package/scripts/openReport.js +1 -1
- package/src/app.html +3 -6
- package/src/hooks.server.js +10 -7
- package/src/lib/README.md +160 -0
- package/src/lib/components/FullWidthSection.svelte +0 -9
- package/src/lib/components/ServiceSummaryTable.svelte +113 -0
- package/src/lib/components/foss/index.js +21 -0
- package/src/lib/components/index.js +31 -0
- package/src/lib/components/layout/HeaderDefault.svelte +3 -1
- package/src/lib/components/layout/HeaderHome.svelte +6 -5
- package/src/lib/components/layout/index.js +21 -0
- package/src/lib/images.js +1 -1
- package/src/lib/index.js +15 -5
- package/src/lib/meta.js +14 -9
- package/src/lib/pages/AboutContent.svelte +51 -15
- package/src/lib/pages/HomeContent.svelte +11 -1
- package/src/lib/pages/LicenseContent.svelte +3 -3
- package/src/lib/pages/PrivacyContent.svelte +31 -1
- package/src/lib/pages/ServicesContent.svelte +545 -0
- package/src/lib/pages/index.js +28 -0
- package/src/lib/stores/posthog.js +2 -1
- package/src/lib/styles/css/default.css +95 -0
- package/src/lib/styles/global.min.css +1 -1
- package/src/lib/styles/index.js +0 -1
- package/src/lib/types/README.md +50 -0
- package/src/lib/types/appConstants.js +1 -1
- package/src/lib/types/fossTypes.js +1 -1
- package/src/lib/utils/getUTMParams.js +1 -1
- package/src/lib/utils/purify.js +1 -1
- package/src/lib/utils/redirect.js +1 -1
- package/src/lib/utils/utm.js +2 -2
- package/src/routes/+layout.svelte +3 -11
- package/src/routes/+page.svelte +9 -7
- package/src/routes/consultation/+page.svelte +1 -1
- package/src/routes/links/+page.svelte +3 -2
- package/src/routes/services/+page.server.js +18 -0
- package/src/routes/services/+page.svelte +65 -0
- package/src/routes/status/+page.server.js +1 -1
- package/src/service-worker.js +2 -2
- package/static/bin/contact.vcf +1 -2
- package/static/disableSw.js +1 -1
- package/static/sitemap.xml +17 -5
- package/tests/e2e/app.spec.js +1 -1
- package/tests/e2e/mobile.spec.js +1 -1
- package/tests/e2e/shared/helpers.js +1 -1
- package/tests/meta/meta.test.js +1 -1
- package/tests/unit/client/lib/PWAInstallButton.test.js +80 -0
- package/tests/unit/client/lib/utils/redirect.test.js +1 -1
- package/tests/unit/server/internal/auditCoverage.test.js +1 -1
- package/tests/unit/server/lib/utils/purify.test.js +1 -1
- package/tests/unit/server/meta.test.js +1 -1
- package/vercel.json +12 -0
- package/vitest-setup-client.js +9 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
tests/unit/client/lib/PWAInstallButton.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 redirect.test.js
|
|
11
|
+
* @description Unit test for PWA install component
|
|
12
|
+
* @module tests/unit/lib
|
|
13
|
+
* @author Scott Lopez
|
|
14
|
+
* @updated 2025-10-05
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import PWAInstallButton from '$lib/components/PWAInstallButton.svelte';
|
|
18
|
+
import { fireEvent, render, waitFor } from '@testing-library/svelte';
|
|
19
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
20
|
+
|
|
21
|
+
/* --------------------------------------------------------------------------
|
|
22
|
+
Fake BeforeInstallPromptEvent Mock
|
|
23
|
+
--------------------------------------------------------------------------
|
|
24
|
+
*/
|
|
25
|
+
class FakeBeforeInstallPromptEvent {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.prompt = vi.fn();
|
|
28
|
+
this.userChoice = Promise.resolve({
|
|
29
|
+
outcome: 'accepted',
|
|
30
|
+
platform: 'test',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* --------------------------------------------------------------------------
|
|
36
|
+
Tests
|
|
37
|
+
-------------------------------------------------------------------------- */
|
|
38
|
+
describe('PWAInstallButton', () => {
|
|
39
|
+
it('shows button when pwa-install-available event is fired', async () => {
|
|
40
|
+
const { getByRole, queryByRole } = render(PWAInstallButton);
|
|
41
|
+
|
|
42
|
+
// Initially, the install button should not be in the DOM
|
|
43
|
+
expect(queryByRole('button')).toBeNull();
|
|
44
|
+
|
|
45
|
+
// Dispatch the custom event that makes the button appear
|
|
46
|
+
const fakeEvent = new FakeBeforeInstallPromptEvent();
|
|
47
|
+
window.dispatchEvent(
|
|
48
|
+
new CustomEvent('pwa-install-available', { detail: fakeEvent }),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Verify that the button now appears
|
|
52
|
+
const button = await waitFor(() =>
|
|
53
|
+
getByRole('button', { name: /install app/i }),
|
|
54
|
+
);
|
|
55
|
+
expect(button).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('calls prompt() when install button is clicked', async () => {
|
|
59
|
+
const { getByRole } = render(PWAInstallButton);
|
|
60
|
+
|
|
61
|
+
// Fire the event that makes the button visible
|
|
62
|
+
const fakeEvent = new FakeBeforeInstallPromptEvent();
|
|
63
|
+
window.dispatchEvent(
|
|
64
|
+
new CustomEvent('pwa-install-available', { detail: fakeEvent }),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// Wait until the button appears
|
|
68
|
+
const button = await waitFor(() =>
|
|
69
|
+
getByRole('button', { name: /install app/i }),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
// Simulate a user clicking the install button
|
|
73
|
+
await fireEvent.click(button);
|
|
74
|
+
|
|
75
|
+
// Verify that prompt() was called — the core behavior we care about
|
|
76
|
+
expect(fakeEvent.prompt).toHaveBeenCalled();
|
|
77
|
+
|
|
78
|
+
// (Removed: button disappearance check, since it depends on async animation timing)
|
|
79
|
+
});
|
|
80
|
+
});
|
package/vercel.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
3
|
+
"version": 2,
|
|
2
4
|
"redirects": [
|
|
3
5
|
{
|
|
4
6
|
"source": "/privacy-policy",
|
|
@@ -30,5 +32,15 @@
|
|
|
30
32
|
"destination": "/foss-spotlight/:path*",
|
|
31
33
|
"permanent": true
|
|
32
34
|
}
|
|
35
|
+
],
|
|
36
|
+
"rewrites": [
|
|
37
|
+
{
|
|
38
|
+
"source": "/relay-MSR0/static/(.*)",
|
|
39
|
+
"destination": "https://us-assets.i.posthog.com/static/$1"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"source": "/relay-MSR0/(.*)",
|
|
43
|
+
"destination": "https://us.i.posthog.com/$1"
|
|
44
|
+
}
|
|
33
45
|
]
|
|
34
46
|
}
|
package/vitest-setup-client.js
CHANGED
|
@@ -25,6 +25,15 @@ Object.defineProperty(window, 'matchMedia', {
|
|
|
25
25
|
})),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
// Mock Web Animations API (jsdom doesn't implement element.animate)
|
|
29
|
+
if (!Element.prototype.animate) {
|
|
30
|
+
Element.prototype.animate = () => ({
|
|
31
|
+
onfinish: null,
|
|
32
|
+
cancel: () => {},
|
|
33
|
+
finished: Promise.resolve(),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
// Automatically clean up the DOM after each test
|
|
29
38
|
afterEach(() => {
|
|
30
39
|
cleanup();
|