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,245 +1,271 @@
|
|
|
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(`Review Resource [${host}]`, () => {
|
|
8
|
+
test.describe('Light Mode', () => {
|
|
9
|
+
test('should render review title with correct styles', async ({ page }) => {
|
|
10
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'light', host }));
|
|
11
|
+
|
|
12
|
+
const iframe = page.frameLocator('iframe');
|
|
13
|
+
const title = iframe.locator('h1:has-text("Refactor Authentication Module")');
|
|
14
|
+
await expect(title).toBeVisible();
|
|
15
|
+
|
|
16
|
+
const styles = await title.evaluate((el) => {
|
|
17
|
+
const computed = window.getComputedStyle(el);
|
|
18
|
+
return {
|
|
19
|
+
fontWeight: computed.fontWeight,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Should render semibold (600)
|
|
24
|
+
expect(parseInt(styles.fontWeight)).toBeGreaterThanOrEqual(600);
|
|
18
25
|
});
|
|
19
26
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
27
|
+
test('should render change items with type-specific styling', async ({ page }) => {
|
|
28
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'light', host }));
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
const iframe = page.frameLocator('iframe');
|
|
31
|
+
const changeItem = iframe.locator('li').first();
|
|
32
|
+
await expect(changeItem).toBeVisible();
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
const styles = await changeItem.evaluate((el) => {
|
|
35
|
+
const computed = window.getComputedStyle(el);
|
|
36
|
+
return {
|
|
37
|
+
borderRadius: computed.borderRadius,
|
|
38
|
+
backgroundColor: computed.backgroundColor,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
30
41
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
borderRadius: computed.borderRadius,
|
|
35
|
-
backgroundColor: computed.backgroundColor,
|
|
36
|
-
};
|
|
42
|
+
// Background should be set (one of the type colors)
|
|
43
|
+
expect(styles.backgroundColor).toBeTruthy();
|
|
44
|
+
expect(styles.backgroundColor).not.toBe('rgba(0, 0, 0, 0)');
|
|
37
45
|
});
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
test('should have interactive apply and cancel buttons', async ({ page }) => {
|
|
48
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'light', host }));
|
|
49
|
+
|
|
50
|
+
const iframe = page.frameLocator('iframe');
|
|
51
|
+
|
|
52
|
+
// Find the Apply Changes button (based on simulation data)
|
|
53
|
+
const applyButton = iframe.locator('button:has-text("Apply Changes")');
|
|
54
|
+
await expect(applyButton).toBeVisible();
|
|
55
|
+
|
|
56
|
+
const applyStyles = await applyButton.evaluate((el) => {
|
|
57
|
+
const computed = window.getComputedStyle(el);
|
|
58
|
+
return {
|
|
59
|
+
cursor: computed.cursor,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
expect(applyStyles.cursor).toBe('pointer');
|
|
63
|
+
|
|
64
|
+
// Find the Cancel button
|
|
65
|
+
const cancelButton = iframe.locator('button:has-text("Cancel")');
|
|
66
|
+
await expect(cancelButton).toBeVisible();
|
|
67
|
+
|
|
68
|
+
const cancelStyles = await cancelButton.evaluate((el) => {
|
|
69
|
+
const computed = window.getComputedStyle(el);
|
|
70
|
+
return {
|
|
71
|
+
cursor: computed.cursor,
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
expect(cancelStyles.cursor).toBe('pointer');
|
|
58
75
|
});
|
|
59
|
-
expect(applyStyles.cursor).toBe('pointer');
|
|
60
|
-
|
|
61
|
-
// Find the Cancel button
|
|
62
|
-
const cancelButton = iframe.locator('button:has-text("Cancel")');
|
|
63
|
-
await expect(cancelButton).toBeVisible();
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
test('should have expand fullscreen button in inline mode', async ({ page }) => {
|
|
78
|
+
await page.goto(
|
|
79
|
+
createSimulatorUrl({
|
|
80
|
+
simulation: 'review-diff',
|
|
81
|
+
theme: 'light',
|
|
82
|
+
displayMode: 'inline',
|
|
83
|
+
host,
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const iframe = page.frameLocator('iframe');
|
|
88
|
+
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
89
|
+
await expect(expandButton).toBeVisible();
|
|
90
|
+
|
|
91
|
+
const styles = await expandButton.evaluate((el) => {
|
|
92
|
+
const computed = window.getComputedStyle(el);
|
|
93
|
+
return {
|
|
94
|
+
cursor: computed.cursor,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
expect(styles.cursor).toBe('pointer');
|
|
70
99
|
});
|
|
71
|
-
expect(cancelStyles.cursor).toBe('pointer');
|
|
72
100
|
});
|
|
73
101
|
|
|
74
|
-
test('
|
|
75
|
-
|
|
76
|
-
createSimulatorUrl({ simulation: 'review-diff', theme: '
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const iframe = page.frameLocator('iframe');
|
|
80
|
-
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
81
|
-
await expect(expandButton).toBeVisible();
|
|
102
|
+
test.describe('Dark Mode', () => {
|
|
103
|
+
test('should render review title with correct styles', async ({ page }) => {
|
|
104
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark', host }));
|
|
82
105
|
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
cursor: computed.cursor,
|
|
87
|
-
};
|
|
106
|
+
const iframe = page.frameLocator('iframe');
|
|
107
|
+
const title = iframe.locator('h1:has-text("Refactor Authentication Module")');
|
|
108
|
+
await expect(title).toBeVisible();
|
|
88
109
|
});
|
|
89
110
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
111
|
+
test('should have appropriate text colors for dark mode', async ({ page }) => {
|
|
112
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark', host }));
|
|
93
113
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
114
|
+
const iframe = page.frameLocator('iframe');
|
|
115
|
+
const title = iframe.locator('h1').first();
|
|
116
|
+
await expect(title).toBeVisible();
|
|
97
117
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark' }));
|
|
105
|
-
|
|
106
|
-
const iframe = page.frameLocator('iframe');
|
|
107
|
-
const title = iframe.locator('h1.text-primary').first();
|
|
108
|
-
await expect(title).toBeVisible();
|
|
118
|
+
const styles = await title.evaluate((el) => {
|
|
119
|
+
const computed = window.getComputedStyle(el);
|
|
120
|
+
return {
|
|
121
|
+
color: computed.color,
|
|
122
|
+
};
|
|
123
|
+
});
|
|
109
124
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
color: computed.color,
|
|
114
|
-
};
|
|
125
|
+
// In dark mode, text color should be light
|
|
126
|
+
expect(styles.color).toBeTruthy();
|
|
115
127
|
});
|
|
116
128
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('should render change items in dark mode', async ({ page }) => {
|
|
122
|
-
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark' }));
|
|
129
|
+
test('should render change items in dark mode', async ({ page }) => {
|
|
130
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark', host }));
|
|
123
131
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test('should load without console errors', async ({ page }) => {
|
|
130
|
-
const errors: string[] = [];
|
|
131
|
-
page.on('console', (msg) => {
|
|
132
|
-
if (msg.type() === 'error') {
|
|
133
|
-
errors.push(msg.text());
|
|
134
|
-
}
|
|
132
|
+
const iframe = page.frameLocator('iframe');
|
|
133
|
+
const changeItem = iframe.locator('li').first();
|
|
134
|
+
await expect(changeItem).toBeVisible();
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const iframe = page.frameLocator('iframe');
|
|
162
|
-
// Wait for content to render first
|
|
163
|
-
await expect(iframe.locator('h1').first()).toBeVisible();
|
|
164
|
-
|
|
165
|
-
// The expand button should not be visible in fullscreen mode
|
|
166
|
-
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
167
|
-
await expect(expandButton).not.toBeVisible();
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
test('should render content correctly in fullscreen', async ({ page }) => {
|
|
171
|
-
await page.goto(
|
|
172
|
-
createSimulatorUrl({ simulation: 'review-diff', theme: 'dark', displayMode: 'fullscreen' })
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
// The root container should be present
|
|
176
|
-
const root = page.locator('#root');
|
|
177
|
-
await expect(root).not.toBeEmpty();
|
|
178
|
-
|
|
179
|
-
// Title should be visible inside the iframe
|
|
180
|
-
const iframe = page.frameLocator('iframe');
|
|
181
|
-
const title = iframe.locator('h1');
|
|
182
|
-
await expect(title).toBeVisible();
|
|
137
|
+
test('should load without console errors', async ({ page }) => {
|
|
138
|
+
const errors: string[] = [];
|
|
139
|
+
page.on('console', (msg) => {
|
|
140
|
+
if (msg.type() === 'error') {
|
|
141
|
+
errors.push(msg.text());
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-diff', theme: 'dark', host }));
|
|
146
|
+
|
|
147
|
+
// Wait for iframe content to render
|
|
148
|
+
const iframe = page.frameLocator('iframe');
|
|
149
|
+
await expect(iframe.locator('h1').first()).toBeVisible();
|
|
150
|
+
|
|
151
|
+
// Filter out expected iframe/MCP handshake errors
|
|
152
|
+
const unexpectedErrors = errors.filter(
|
|
153
|
+
(e) =>
|
|
154
|
+
!e.includes('[IframeResource]') &&
|
|
155
|
+
!e.includes('mcp') &&
|
|
156
|
+
!e.includes('PostMessage') &&
|
|
157
|
+
!e.includes('connect')
|
|
158
|
+
);
|
|
159
|
+
expect(unexpectedErrors).toHaveLength(0);
|
|
160
|
+
});
|
|
183
161
|
});
|
|
184
162
|
|
|
185
|
-
test('
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
163
|
+
test.describe('Fullscreen Mode', () => {
|
|
164
|
+
test('should not show fullscreen button when already in fullscreen', async ({ page }) => {
|
|
165
|
+
await page.goto(
|
|
166
|
+
createSimulatorUrl({
|
|
167
|
+
simulation: 'review-diff',
|
|
168
|
+
theme: 'light',
|
|
169
|
+
displayMode: 'fullscreen',
|
|
170
|
+
host,
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const iframe = page.frameLocator('iframe');
|
|
175
|
+
// Wait for content to render first
|
|
176
|
+
await expect(iframe.locator('h1').first()).toBeVisible();
|
|
177
|
+
|
|
178
|
+
// The expand button should not be visible in fullscreen mode
|
|
179
|
+
const expandButton = iframe.locator('button[aria-label="Enter fullscreen"]');
|
|
180
|
+
await expect(expandButton).not.toBeVisible();
|
|
181
|
+
});
|
|
193
182
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
test('should render content correctly in fullscreen', async ({ page }) => {
|
|
184
|
+
await page.goto(
|
|
185
|
+
createSimulatorUrl({
|
|
186
|
+
simulation: 'review-diff',
|
|
187
|
+
theme: 'dark',
|
|
188
|
+
displayMode: 'fullscreen',
|
|
189
|
+
host,
|
|
190
|
+
})
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
// The root container should be present
|
|
194
|
+
const root = page.locator('#root');
|
|
195
|
+
await expect(root).not.toBeEmpty();
|
|
196
|
+
|
|
197
|
+
// Title should be visible inside the iframe
|
|
198
|
+
const iframe = page.frameLocator('iframe');
|
|
199
|
+
const title = iframe.locator('h1');
|
|
200
|
+
await expect(title).toBeVisible();
|
|
199
201
|
});
|
|
200
202
|
|
|
201
|
-
|
|
203
|
+
test('should have scrollable content area in fullscreen', async ({ page }) => {
|
|
204
|
+
await page.goto(
|
|
205
|
+
createSimulatorUrl({
|
|
206
|
+
simulation: 'review-diff',
|
|
207
|
+
theme: 'light',
|
|
208
|
+
displayMode: 'fullscreen',
|
|
209
|
+
host,
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
const iframe = page.frameLocator('iframe');
|
|
214
|
+
const contentArea = iframe.locator('.overflow-y-auto').first();
|
|
215
|
+
await expect(contentArea).toBeVisible();
|
|
216
|
+
|
|
217
|
+
const styles = await contentArea.evaluate((el) => {
|
|
218
|
+
const computed = window.getComputedStyle(el);
|
|
219
|
+
return {
|
|
220
|
+
overflowY: computed.overflowY,
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
expect(styles.overflowY).toBe('auto');
|
|
225
|
+
});
|
|
202
226
|
});
|
|
203
|
-
});
|
|
204
227
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
test.describe('Review Post Simulation', () => {
|
|
229
|
+
test('should render post review in light mode', async ({ page }) => {
|
|
230
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-post', theme: 'light', host }));
|
|
208
231
|
|
|
209
|
-
|
|
232
|
+
await page.waitForLoadState('networkidle');
|
|
210
233
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
234
|
+
// Should render the review content
|
|
235
|
+
const root = page.locator('#root');
|
|
236
|
+
await expect(root).not.toBeEmpty();
|
|
237
|
+
});
|
|
215
238
|
|
|
216
|
-
|
|
217
|
-
|
|
239
|
+
test('should render post review in dark mode', async ({ page }) => {
|
|
240
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-post', theme: 'dark', host }));
|
|
218
241
|
|
|
219
|
-
|
|
242
|
+
await page.waitForLoadState('networkidle');
|
|
220
243
|
|
|
221
|
-
|
|
222
|
-
|
|
244
|
+
const root = page.locator('#root');
|
|
245
|
+
await expect(root).not.toBeEmpty();
|
|
246
|
+
});
|
|
223
247
|
});
|
|
224
|
-
});
|
|
225
248
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
249
|
+
test.describe('Review Purchase Simulation', () => {
|
|
250
|
+
test('should render purchase review in light mode', async ({ page }) => {
|
|
251
|
+
await page.goto(
|
|
252
|
+
createSimulatorUrl({ simulation: 'review-purchase', theme: 'light', host })
|
|
253
|
+
);
|
|
229
254
|
|
|
230
|
-
|
|
255
|
+
await page.waitForLoadState('networkidle');
|
|
231
256
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
257
|
+
const root = page.locator('#root');
|
|
258
|
+
await expect(root).not.toBeEmpty();
|
|
259
|
+
});
|
|
235
260
|
|
|
236
|
-
|
|
237
|
-
|
|
261
|
+
test('should render purchase review in dark mode', async ({ page }) => {
|
|
262
|
+
await page.goto(createSimulatorUrl({ simulation: 'review-purchase', theme: 'dark', host }));
|
|
238
263
|
|
|
239
|
-
|
|
264
|
+
await page.waitForLoadState('networkidle');
|
|
240
265
|
|
|
241
|
-
|
|
242
|
-
|
|
266
|
+
const root = page.locator('#root');
|
|
267
|
+
await expect(root).not.toBeEmpty();
|
|
268
|
+
});
|
|
243
269
|
});
|
|
244
270
|
});
|
|
245
|
-
}
|
|
271
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
-
function getDefaultExportFromCjs(x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5
|
-
}
|
|
6
|
-
exports.commonjsGlobal = commonjsGlobal;
|
|
7
|
-
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
8
|
-
//# sourceMappingURL=_commonjsHelpers-Bc2YnDe1.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers-Bc2YnDe1.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
-
function getDefaultExportFromCjs(x) {
|
|
3
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
commonjsGlobal as c,
|
|
7
|
-
getDefaultExportFromCjs as g
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=_commonjsHelpers-DWwsNxpa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers-DWwsNxpa.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|