sunpeak 0.14.3 → 0.15.1
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 +32 -28
- package/bin/commands/build.mjs +2 -1
- package/bin/commands/dev.mjs +72 -2
- package/dist/chatgpt/{conversation.d.ts → chatgpt-conversation.d.ts} +1 -1
- package/dist/chatgpt/chatgpt-host.d.ts +1 -0
- package/dist/chatgpt/globals.css +618 -6156
- package/dist/chatgpt/index.cjs +11 -8
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +10 -32
- package/dist/chatgpt/index.js +15 -12
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/claude-conversation.d.ts +23 -0
- package/dist/claude/claude-host.d.ts +1 -0
- package/dist/claude/index.cjs +6 -0
- package/dist/claude/index.cjs.map +1 -0
- package/dist/claude/index.d.ts +1 -0
- package/dist/claude/index.js +6 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude-host-C7KPfOM8.cjs +284 -0
- package/dist/claude-host-C7KPfOM8.cjs.map +1 -0
- package/dist/claude-host-CaD7ptbt.js +283 -0
- package/dist/claude-host-CaD7ptbt.js.map +1 -0
- package/dist/{discovery-COZUnY6a.js → discovery-DzV3HLXs.js} +5 -5
- package/dist/{discovery-COZUnY6a.js.map → discovery-DzV3HLXs.js.map} +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/use-app-tools.d.ts +44 -0
- package/dist/hooks/use-update-model-context.d.ts +29 -0
- package/dist/index-BKrboRah.js +44 -0
- package/dist/index-BKrboRah.js.map +1 -0
- package/dist/index-BSKuY-oH.cjs +527 -0
- package/dist/index-BSKuY-oH.cjs.map +1 -0
- package/dist/index-CiqvXo8n.js +512 -0
- package/dist/index-CiqvXo8n.js.map +1 -0
- package/dist/index-Dr-L0Nb3.cjs +43 -0
- package/dist/index-Dr-L0Nb3.cjs.map +1 -0
- package/dist/index.cjs +1705 -1647
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2732 -2675
- package/dist/index.js.map +1 -1
- package/dist/lib/default-style-variables.d.ts +2 -0
- package/dist/lib/discovery-cli.js +1 -1
- package/dist/mcp/index.cjs +86 -27
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +3 -1
- package/dist/mcp/index.js +85 -26
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +4 -3
- package/dist/mcp/types.d.ts +11 -0
- package/dist/platform/chatgpt/index.cjs +1 -1
- package/dist/platform/chatgpt/index.js +1 -1
- package/dist/platform/index.cjs +3 -0
- package/dist/platform/index.cjs.map +1 -1
- package/dist/platform/index.d.ts +3 -1
- package/dist/platform/index.js +3 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/{protocol-BQCnIrc9.js → protocol-DFbsCx7E.js} +29 -29
- package/dist/{protocol-BQCnIrc9.js.map → protocol-DFbsCx7E.js.map} +1 -1
- package/dist/simulator/host-styles.d.ts +5 -0
- package/dist/simulator/hosts.d.ts +73 -0
- package/dist/{chatgpt → simulator}/iframe-resource.d.ts +27 -3
- package/dist/simulator/index.cjs +40 -0
- package/dist/simulator/index.cjs.map +1 -0
- package/dist/simulator/index.d.ts +18 -0
- package/dist/simulator/index.js +40 -0
- package/dist/simulator/index.js.map +1 -0
- package/dist/{chatgpt → simulator}/mcp-app-host.d.ts +8 -1
- package/dist/simulator/mock-openai-runtime.d.ts +20 -0
- package/dist/{chatgpt → simulator}/simulator-url.d.ts +8 -1
- package/dist/simulator/simulator.d.ts +12 -0
- package/dist/{chatgpt → simulator}/theme-provider.d.ts +3 -1
- package/dist/simulator/use-simulator-state.d.ts +91 -0
- package/dist/simulator-BqZmzFVR.cjs +8214 -0
- package/dist/simulator-BqZmzFVR.cjs.map +1 -0
- package/dist/simulator-CMgCGNuD.js +8199 -0
- package/dist/simulator-CMgCGNuD.js.map +1 -0
- package/dist/simulator-url-BQ-7SMht.js +335 -0
- package/dist/simulator-url-BQ-7SMht.js.map +1 -0
- package/dist/simulator-url-uNqOCaPJ.cjs +334 -0
- package/dist/simulator-url-uNqOCaPJ.cjs.map +1 -0
- package/dist/style.css +558 -6143
- package/dist/types/runtime.d.ts +1 -1
- package/dist/{use-app-D7kRAPSG.cjs → use-app-BnoSPiUT.cjs} +2 -1
- package/dist/{use-app-D7kRAPSG.cjs.map → use-app-BnoSPiUT.cjs.map} +1 -1
- package/dist/{use-app-Dvr4LKs2.js → use-app-D_TeaMFG.js} +4 -3
- package/dist/{use-app-Dvr4LKs2.js.map → use-app-D_TeaMFG.js.map} +1 -1
- package/package.json +18 -3
- package/template/.sunpeak/dev.tsx +4 -4
- package/template/.sunpeak/resource-loader.html +1 -1
- package/template/node_modules/.bin/nodemon +2 -2
- package/template/node_modules/.bin/playwright +2 -2
- package/template/node_modules/.bin/sunpeak +2 -2
- package/template/node_modules/.bin/tsc +2 -2
- package/template/node_modules/.bin/tsserver +2 -2
- package/template/node_modules/.bin/tsx +2 -2
- package/template/node_modules/.bin/vite +2 -2
- package/template/src/components/avatar.tsx +4 -1
- package/template/src/components/button.tsx +17 -20
- package/template/src/resources/albums/albums-resource.tsx +2 -3
- package/template/src/resources/albums/components/album-card.tsx +4 -2
- package/template/src/resources/albums/components/film-strip.test.tsx +2 -2
- package/template/src/resources/albums/components/film-strip.tsx +2 -2
- package/template/src/resources/albums/components/fullscreen-viewer.tsx +7 -5
- package/template/src/resources/carousel/carousel-resource.tsx +2 -3
- package/template/src/resources/carousel/components/card.test.tsx +3 -2
- package/template/src/resources/carousel/components/card.tsx +8 -4
- package/template/src/resources/map/components/map-view.tsx +1 -1
- package/template/src/resources/map/components/map.tsx +1 -1
- package/template/src/resources/map/components/place-card.tsx +8 -4
- package/template/src/resources/map/components/place-carousel.tsx +1 -1
- package/template/src/resources/map/components/place-inspector.tsx +15 -7
- package/template/src/resources/map/components/place-list.tsx +7 -4
- package/template/src/resources/map/map-resource.tsx +0 -2
- package/template/src/resources/review/review-resource.tsx +61 -27
- package/template/tests/e2e/albums.spec.ts +118 -102
- package/template/tests/e2e/carousel.spec.ts +103 -100
- package/template/tests/e2e/map.spec.ts +220 -181
- package/template/tests/e2e/review.spec.ts +224 -198
- package/dist/_commonjsHelpers-Bc2YnDe1.cjs +0 -8
- package/dist/_commonjsHelpers-Bc2YnDe1.cjs.map +0 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
- package/dist/index-CJ3jfcjj.js +0 -15131
- package/dist/index-CJ3jfcjj.js.map +0 -1
- package/dist/index-Cdeg96So.cjs +0 -15147
- package/dist/index-Cdeg96So.cjs.map +0 -1
- /package/dist/{chatgpt → simulator}/simple-sidebar.d.ts +0 -0
- /package/dist/{chatgpt/chatgpt-simulator-types.d.ts → simulator/simulator-types.d.ts} +0 -0
|
@@ -1,206 +1,245 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test';
|
|
2
2
|
import { createSimulatorUrl } from 'sunpeak/chatgpt';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
const hosts = ['chatgpt', 'claude'] as const;
|
|
5
|
+
|
|
6
|
+
for (const host of hosts) {
|
|
7
|
+
test.describe(`Map Resource [${host}]`, () => {
|
|
8
|
+
test.describe('Light Mode', () => {
|
|
9
|
+
test('should render map container with correct styles', async ({ page }) => {
|
|
10
|
+
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'light', host }));
|
|
11
|
+
|
|
12
|
+
const iframe = page.frameLocator('iframe');
|
|
13
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
14
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
15
|
+
|
|
16
|
+
const styles = await mapContainer.evaluate((el) => {
|
|
17
|
+
const computed = window.getComputedStyle(el);
|
|
18
|
+
return {
|
|
19
|
+
overflow: computed.overflow,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
expect(styles.overflow).toBe('hidden');
|
|
18
24
|
});
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
test('should have rounded border in inline mode', async ({ page }) => {
|
|
27
|
+
await page.goto(
|
|
28
|
+
createSimulatorUrl({
|
|
29
|
+
simulation: 'map-show',
|
|
30
|
+
theme: 'light',
|
|
31
|
+
displayMode: 'inline',
|
|
32
|
+
host,
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const iframe = page.frameLocator('iframe');
|
|
37
|
+
const innerContainer = iframe.locator('.border.rounded-2xl').first();
|
|
38
|
+
await expect(innerContainer).toBeVisible({ timeout: 10000 });
|
|
39
|
+
|
|
40
|
+
const styles = await innerContainer.evaluate((el) => {
|
|
41
|
+
const computed = window.getComputedStyle(el);
|
|
42
|
+
return {
|
|
43
|
+
borderRadius: computed.borderRadius,
|
|
44
|
+
borderWidth: computed.borderWidth,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Should have rounded corners (rounded-2xl = 16px)
|
|
49
|
+
expect(parseInt(styles.borderRadius)).toBeGreaterThanOrEqual(16);
|
|
38
50
|
});
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
test('should have fullscreen expand button in inline mode', async ({ page }) => {
|
|
53
|
+
await page.goto(
|
|
54
|
+
createSimulatorUrl({
|
|
55
|
+
simulation: 'map-show',
|
|
56
|
+
theme: 'light',
|
|
57
|
+
displayMode: 'inline',
|
|
58
|
+
host,
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const iframe = page.frameLocator('iframe');
|
|
63
|
+
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
64
|
+
await expect(expandButton).toBeVisible({ timeout: 10000 });
|
|
65
|
+
|
|
66
|
+
const styles = await expandButton.evaluate((el) => {
|
|
67
|
+
const computed = window.getComputedStyle(el);
|
|
68
|
+
return {
|
|
69
|
+
cursor: computed.cursor,
|
|
70
|
+
position: computed.position,
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(styles.cursor).toBe('pointer');
|
|
75
|
+
expect(styles.position).toBe('absolute');
|
|
59
76
|
});
|
|
60
77
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
test('should load without console errors', async ({ page }) => {
|
|
79
|
+
const errors: string[] = [];
|
|
80
|
+
page.on('console', (msg) => {
|
|
81
|
+
if (msg.type() === 'error') {
|
|
82
|
+
errors.push(msg.text());
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'light', host }));
|
|
87
|
+
|
|
88
|
+
const iframe = page.frameLocator('iframe');
|
|
89
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
90
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
91
|
+
|
|
92
|
+
// Filter out expected iframe/MCP handshake errors
|
|
93
|
+
const unexpectedErrors = errors.filter(
|
|
94
|
+
(e) =>
|
|
95
|
+
!e.includes('[IframeResource]') &&
|
|
96
|
+
!e.includes('mcp') &&
|
|
97
|
+
!e.includes('PostMessage') &&
|
|
98
|
+
!e.includes('connect')
|
|
99
|
+
);
|
|
100
|
+
expect(unexpectedErrors).toHaveLength(0);
|
|
71
101
|
});
|
|
72
|
-
|
|
73
|
-
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'light' }));
|
|
74
|
-
|
|
75
|
-
const iframe = page.frameLocator('iframe');
|
|
76
|
-
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
77
|
-
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
78
|
-
|
|
79
|
-
// Filter out expected iframe/MCP handshake errors
|
|
80
|
-
const unexpectedErrors = errors.filter(
|
|
81
|
-
(e) =>
|
|
82
|
-
!e.includes('[IframeResource]') &&
|
|
83
|
-
!e.includes('mcp') &&
|
|
84
|
-
!e.includes('PostMessage') &&
|
|
85
|
-
!e.includes('connect')
|
|
86
|
-
);
|
|
87
|
-
expect(unexpectedErrors).toHaveLength(0);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
test.describe('Dark Mode', () => {
|
|
92
|
-
test('should render map container with correct styles', async ({ page }) => {
|
|
93
|
-
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'dark' }));
|
|
94
|
-
|
|
95
|
-
const iframe = page.frameLocator('iframe');
|
|
96
|
-
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
97
|
-
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
98
102
|
});
|
|
99
103
|
|
|
100
|
-
test('
|
|
101
|
-
|
|
102
|
-
createSimulatorUrl({ simulation: 'map-show', theme: 'dark',
|
|
103
|
-
);
|
|
104
|
+
test.describe('Dark Mode', () => {
|
|
105
|
+
test('should render map container with correct styles', async ({ page }) => {
|
|
106
|
+
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'dark', host }));
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const styles = await innerContainer.evaluate((el) => {
|
|
110
|
-
const computed = window.getComputedStyle(el);
|
|
111
|
-
return {
|
|
112
|
-
borderColor: computed.borderColor,
|
|
113
|
-
};
|
|
108
|
+
const iframe = page.frameLocator('iframe');
|
|
109
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
110
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
114
111
|
});
|
|
115
112
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
test('should have appropriate border color for dark mode', async ({ page }) => {
|
|
114
|
+
await page.goto(
|
|
115
|
+
createSimulatorUrl({
|
|
116
|
+
simulation: 'map-show',
|
|
117
|
+
theme: 'dark',
|
|
118
|
+
displayMode: 'inline',
|
|
119
|
+
host,
|
|
120
|
+
})
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const iframe = page.frameLocator('iframe');
|
|
124
|
+
const innerContainer = iframe.locator('.border.rounded-2xl').first();
|
|
125
|
+
await expect(innerContainer).toBeVisible({ timeout: 10000 });
|
|
126
|
+
|
|
127
|
+
const styles = await innerContainer.evaluate((el) => {
|
|
128
|
+
const computed = window.getComputedStyle(el);
|
|
129
|
+
return {
|
|
130
|
+
borderColor: computed.borderColor,
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Border color should be set
|
|
135
|
+
expect(styles.borderColor).toBeTruthy();
|
|
126
136
|
});
|
|
127
137
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const iframe = page.frameLocator('iframe');
|
|
153
|
-
const innerContainer = iframe.locator('.rounded-none.border-0').first();
|
|
154
|
-
await expect(innerContainer).toBeVisible({ timeout: 10000 });
|
|
155
|
-
|
|
156
|
-
const styles = await innerContainer.evaluate((el) => {
|
|
157
|
-
const computed = window.getComputedStyle(el);
|
|
158
|
-
return {
|
|
159
|
-
borderRadius: computed.borderRadius,
|
|
160
|
-
};
|
|
138
|
+
test('should load without console errors', async ({ page }) => {
|
|
139
|
+
const errors: string[] = [];
|
|
140
|
+
page.on('console', (msg) => {
|
|
141
|
+
if (msg.type() === 'error') {
|
|
142
|
+
errors.push(msg.text());
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
await page.goto(createSimulatorUrl({ simulation: 'map-show', theme: 'dark', host }));
|
|
147
|
+
|
|
148
|
+
const iframe = page.frameLocator('iframe');
|
|
149
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
150
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
151
|
+
|
|
152
|
+
// Filter out expected iframe/MCP handshake errors
|
|
153
|
+
const unexpectedErrors = errors.filter(
|
|
154
|
+
(e) =>
|
|
155
|
+
!e.includes('[IframeResource]') &&
|
|
156
|
+
!e.includes('mcp') &&
|
|
157
|
+
!e.includes('PostMessage') &&
|
|
158
|
+
!e.includes('connect')
|
|
159
|
+
);
|
|
160
|
+
expect(unexpectedErrors).toHaveLength(0);
|
|
161
161
|
});
|
|
162
|
-
|
|
163
|
-
expect(styles.borderRadius).toBe('0px');
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
test('should not show fullscreen button when already in fullscreen', async ({ page }) => {
|
|
167
|
-
await page.goto(
|
|
168
|
-
createSimulatorUrl({ simulation: 'map-show', theme: 'light', displayMode: 'fullscreen' })
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
const iframe = page.frameLocator('iframe');
|
|
172
|
-
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
173
|
-
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
174
|
-
|
|
175
|
-
// The expand button should not be visible in fullscreen mode
|
|
176
|
-
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
177
|
-
await expect(expandButton).not.toBeVisible();
|
|
178
162
|
});
|
|
179
163
|
|
|
180
|
-
test('
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
164
|
+
test.describe('Fullscreen Mode', () => {
|
|
165
|
+
test('should not have rounded border in fullscreen mode', async ({ page }) => {
|
|
166
|
+
await page.goto(
|
|
167
|
+
createSimulatorUrl({
|
|
168
|
+
simulation: 'map-show',
|
|
169
|
+
theme: 'light',
|
|
170
|
+
displayMode: 'fullscreen',
|
|
171
|
+
host,
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const iframe = page.frameLocator('iframe');
|
|
176
|
+
const innerContainer = iframe.locator('.rounded-none.border-0').first();
|
|
177
|
+
await expect(innerContainer).toBeVisible({ timeout: 10000 });
|
|
178
|
+
|
|
179
|
+
const styles = await innerContainer.evaluate((el) => {
|
|
180
|
+
const computed = window.getComputedStyle(el);
|
|
181
|
+
return {
|
|
182
|
+
borderRadius: computed.borderRadius,
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
expect(styles.borderRadius).toBe('0px');
|
|
187
|
+
});
|
|
189
188
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
test('should not show fullscreen button when already in fullscreen', async ({ page }) => {
|
|
190
|
+
await page.goto(
|
|
191
|
+
createSimulatorUrl({
|
|
192
|
+
simulation: 'map-show',
|
|
193
|
+
theme: 'light',
|
|
194
|
+
displayMode: 'fullscreen',
|
|
195
|
+
host,
|
|
196
|
+
})
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
const iframe = page.frameLocator('iframe');
|
|
200
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
201
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
202
|
+
|
|
203
|
+
// The expand button should not be visible in fullscreen mode
|
|
204
|
+
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
205
|
+
await expect(expandButton).not.toBeVisible();
|
|
206
|
+
});
|
|
196
207
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
208
|
+
test('should show place list sidebar in fullscreen', async ({ page }) => {
|
|
209
|
+
await page.goto(
|
|
210
|
+
createSimulatorUrl({
|
|
211
|
+
simulation: 'map-show',
|
|
212
|
+
theme: 'dark',
|
|
213
|
+
displayMode: 'fullscreen',
|
|
214
|
+
host,
|
|
215
|
+
})
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
const iframe = page.frameLocator('iframe');
|
|
219
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
220
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
221
|
+
});
|
|
200
222
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
223
|
+
test('should show suggestion chips in fullscreen on desktop', async ({ page }) => {
|
|
224
|
+
// Set viewport to desktop size
|
|
225
|
+
await page.setViewportSize({ width: 1024, height: 768 });
|
|
226
|
+
await page.goto(
|
|
227
|
+
createSimulatorUrl({
|
|
228
|
+
simulation: 'map-show',
|
|
229
|
+
theme: 'light',
|
|
230
|
+
displayMode: 'fullscreen',
|
|
231
|
+
host,
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
const iframe = page.frameLocator('iframe');
|
|
236
|
+
const mapContainer = iframe.locator('.antialiased.w-full.overflow-hidden').first();
|
|
237
|
+
await expect(mapContainer).toBeVisible({ timeout: 10000 });
|
|
238
|
+
|
|
239
|
+
// Suggestion chips should be visible (contains "Open now", "Top rated", etc.)
|
|
240
|
+
const openNowChip = iframe.locator('button:has-text("Open now")');
|
|
241
|
+
await expect(openNowChip).toBeVisible({ timeout: 5000 });
|
|
242
|
+
});
|
|
204
243
|
});
|
|
205
244
|
});
|
|
206
|
-
}
|
|
245
|
+
}
|