sunpeak 0.18.14 → 0.19.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/README.md +37 -134
- package/bin/commands/new.mjs +3 -1
- package/bin/commands/test-init.mjs +305 -0
- package/bin/commands/test.mjs +144 -0
- package/bin/lib/inspect/inspect-config.d.mts +4 -0
- package/bin/lib/inspect/inspect-config.mjs +18 -24
- package/bin/lib/test/base-config.mjs +75 -0
- package/bin/lib/test/matchers.mjs +99 -0
- package/bin/lib/test/test-config.d.mts +66 -0
- package/bin/lib/test/test-config.mjs +125 -0
- package/bin/lib/test/test-fixtures.d.mts +129 -0
- package/bin/lib/test/test-fixtures.mjs +232 -0
- package/bin/sunpeak.js +18 -5
- package/package.json +22 -10
- package/template/README.md +18 -8
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +468 -280
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.bin/playwright +2 -2
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/node_modules/.vite/deps/_metadata.json +4 -4
- package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +15924 -14588
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/vitest.js +8 -8
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
- package/template/package.json +9 -7
- package/template/playwright.config.ts +2 -40
- package/template/test-results/.last-run.json +4 -0
- package/template/tests/e2e/albums.spec.ts +114 -245
- package/template/tests/e2e/carousel.spec.ts +189 -313
- package/template/tests/e2e/map.spec.ts +177 -300
- package/template/tests/e2e/review.spec.ts +232 -423
- package/template/tests/e2e/visual.spec.ts +36 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-chatgpt-linux.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-claude-linux.png +0 -0
- package/template/tests/live/albums.spec.ts +1 -1
- package/template/tests/live/carousel.spec.ts +1 -1
- package/template/tests/live/map.spec.ts +1 -1
- package/template/tests/live/playwright.config.ts +1 -1
- package/template/tests/live/review.spec.ts +1 -1
- package/template/vitest.config.ts +1 -1
- package/template/tests/e2e/global-setup.ts +0 -10
- package/template/tests/e2e/helpers.ts +0 -13
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { test, expect } from 'sunpeak/test';
|
|
2
|
+
|
|
3
|
+
// Visual regression tests. Screenshot comparisons only run with `sunpeak test --visual`.
|
|
4
|
+
// Update baselines with `sunpeak test --visual --update`.
|
|
5
|
+
|
|
6
|
+
test('albums renders correctly in light mode', async ({ mcp }) => {
|
|
7
|
+
const result = await mcp.callTool('show-albums', {}, { theme: 'light' });
|
|
8
|
+
const app = result.app();
|
|
9
|
+
await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
|
|
10
|
+
|
|
11
|
+
await mcp.screenshot('albums-light');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('albums renders correctly in dark mode', async ({ mcp }) => {
|
|
15
|
+
const result = await mcp.callTool('show-albums', {}, { theme: 'dark' });
|
|
16
|
+
const app = result.app();
|
|
17
|
+
await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
|
|
18
|
+
|
|
19
|
+
await mcp.screenshot('albums-dark');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('albums renders correctly in fullscreen', async ({ mcp }) => {
|
|
23
|
+
const result = await mcp.callTool('show-albums', {}, { displayMode: 'fullscreen' });
|
|
24
|
+
const app = result.app();
|
|
25
|
+
await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
|
|
26
|
+
|
|
27
|
+
await mcp.screenshot('albums-fullscreen');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('full page renders correctly', async ({ mcp }) => {
|
|
31
|
+
const result = await mcp.callTool('show-albums', {}, { theme: 'light' });
|
|
32
|
+
const app = result.app();
|
|
33
|
+
await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
|
|
34
|
+
|
|
35
|
+
await mcp.screenshot('albums-page-light', { target: 'page', maxDiffPixelRatio: 0.02 });
|
|
36
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -8,7 +8,7 @@ const parentSrc = path.resolve(__dirname, '../src');
|
|
|
8
8
|
export default defineConfig({
|
|
9
9
|
test: {
|
|
10
10
|
globals: true,
|
|
11
|
-
environment: '
|
|
11
|
+
environment: 'happy-dom',
|
|
12
12
|
setupFiles: './tests/setup.ts',
|
|
13
13
|
exclude: ['**/node_modules/**', '**/tests/e2e/**', '**/tests/live/**'],
|
|
14
14
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Playwright global setup.
|
|
3
|
-
*
|
|
4
|
-
* The webServer (pnpm dev) handles building resources via its build watcher.
|
|
5
|
-
* No separate build step needed here — the dev server's initial build creates
|
|
6
|
-
* dist/ files before serving the first request.
|
|
7
|
-
*/
|
|
8
|
-
export default function globalSetup() {
|
|
9
|
-
// Nothing to do — the webServer handles everything.
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createInspectorUrl as _createInspectorUrl,
|
|
3
|
-
type InspectorUrlParams,
|
|
4
|
-
} from 'sunpeak/chatgpt';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Wrapper around createInspectorUrl that hides the dev overlay by default.
|
|
8
|
-
* The overlay shows resource timestamps and tool timing, which can interfere
|
|
9
|
-
* with element assertions in e2e tests.
|
|
10
|
-
*/
|
|
11
|
-
export function createInspectorUrl(params: InspectorUrlParams, basePath?: string): string {
|
|
12
|
-
return _createInspectorUrl({ devOverlay: false, ...params }, basePath);
|
|
13
|
-
}
|