@chromatic-com/vitest 0.0.1 → 0.0.2-07acb2c-20260421094034
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/dist/plugin.js +7 -4
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -4092,14 +4092,17 @@ function createCommands(options) {
|
|
|
4092
4092
|
for (const [name, domSnapshot] of sessionSnapshots) {
|
|
4093
4093
|
snapshotBuffers[name] = Buffer.from(JSON.stringify(domSnapshot));
|
|
4094
4094
|
}
|
|
4095
|
+
const frame = await context.frame();
|
|
4096
|
+
const frameElement = await frame.frameElement();
|
|
4097
|
+
const viewport = await frameElement.evaluate((iframe) => ({
|
|
4098
|
+
width: iframe.parentElement?.clientWidth || 1920,
|
|
4099
|
+
height: iframe.parentElement?.clientHeight || 1080
|
|
4100
|
+
}));
|
|
4095
4101
|
await writeTestResult({
|
|
4096
4102
|
outputDir: resolve(context.project.config.root, options.outputDirectory),
|
|
4097
4103
|
pageUrl: context.page.url(),
|
|
4098
4104
|
titlePath: getNames(entity),
|
|
4099
|
-
viewport
|
|
4100
|
-
width: 1920,
|
|
4101
|
-
height: 1080
|
|
4102
|
-
}
|
|
4105
|
+
viewport
|
|
4103
4106
|
}, snapshotBuffers, archive, {
|
|
4104
4107
|
delay: options.delay,
|
|
4105
4108
|
diffIncludeAntiAliasing: options.diffIncludeAntiAliasing,
|