diff --git a/assets/frames/android-pixel.html b/assets/frames/android-pixel.html index 85df84c44..6acbbf7b4 100644 --- a/assets/frames/android-pixel.html +++ b/assets/frames/android-pixel.html @@ -149,9 +149,13 @@ diff --git a/assets/frames/browser-chrome.html b/assets/frames/browser-chrome.html index 6ad76ff26..de4d617e6 100644 --- a/assets/frames/browser-chrome.html +++ b/assets/frames/browser-chrome.html @@ -119,10 +119,15 @@ diff --git a/assets/frames/ipad-pro.html b/assets/frames/ipad-pro.html index 256db5ac8..7db169a4b 100644 --- a/assets/frames/ipad-pro.html +++ b/assets/frames/ipad-pro.html @@ -87,9 +87,13 @@ diff --git a/assets/frames/iphone-15-pro.html b/assets/frames/iphone-15-pro.html index 60963ce4e..f74784bbe 100644 --- a/assets/frames/iphone-15-pro.html +++ b/assets/frames/iphone-15-pro.html @@ -166,9 +166,13 @@ diff --git a/assets/frames/macbook.html b/assets/frames/macbook.html index f94628ff2..107bb5f49 100644 --- a/assets/frames/macbook.html +++ b/assets/frames/macbook.html @@ -126,9 +126,13 @@ diff --git a/e2e/tests/frames/screen-resolution.test.ts b/e2e/tests/frames/screen-resolution.test.ts new file mode 100644 index 000000000..a1ed51d40 --- /dev/null +++ b/e2e/tests/frames/screen-resolution.test.ts @@ -0,0 +1,128 @@ +import { readFileSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import vm from 'node:vm'; + +import { describe, expect, it } from 'vitest'; + +const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)); +const framesDir = path.join(repoRoot, 'assets', 'frames'); + +const FRAME_FILES = [ + 'iphone-15-pro.html', + 'android-pixel.html', + 'ipad-pro.html', + 'macbook.html', + 'browser-chrome.html', +] as const; + +function extractFrameScript(htmlPath: string): string { + const html = readFileSync(htmlPath, 'utf8'); + const matches = html.matchAll(/