authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 22:33:29-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 22:33:29-07:00
logf1e84c28fe5982ecb507f4c934acf7a1a7b253b7
tree82f347c841c0fb9c9e2be48175c604d9760925fd
parent420fd76f60433fe05b8d2c76f4fbde430dc49968
signature Signed by PGP key B5690EEEBB952194

test(web): keep settings viewport comparison private (#10307)


2 files changed, 1 insertions(+), 24 deletions(-)

apps/web/src/components/settings/SettingsPanels.logic.test.ts-23
......@@ -14,7 +14,6 @@ import {
1414 formatDiagnosticsDescription,
1515 getChangedBrowserSettingLabels,
1616 getChangedTypographySettingLabels,
17 isSamePreviewViewport,
1817 hasChangedBackgroundActivitySettings,
1918 isProjectGroupingEnabled,
2019 projectGroupingModeFromToggle,
......@@ -282,25 +281,3 @@ describe("getChangedBrowserSettingLabels", () => {
282281 ]);
283282 });
284283});
285
286describe("isSamePreviewViewport", () => {
287 it("separates presets that share a size", () => {
288 // Two presets can agree on width and height and still be different
289 // entries in the picker, so the id has to take part in the comparison.
290 expect(
291 isSamePreviewViewport(
292 { _tag: "preset", width: 390, height: 844, presetId: "iphone-12-pro" },
293 { _tag: "preset", width: 390, height: 844, presetId: "ipad-mini" },
294 ),
295 ).toBe(false);
296 });
297
298 it("separates a freeform viewport from a preset of the same size", () => {
299 expect(
300 isSamePreviewViewport(
301 { _tag: "freeform", width: 390, height: 844 },
302 { _tag: "preset", width: 390, height: 844, presetId: "iphone-12-pro" },
303 ),
304 ).toBe(false);
305 });
306});
apps/web/src/components/settings/SettingsPanels.logic.ts+1-1
......@@ -126,7 +126,7 @@ export type BrowserDefaultSettings = Pick<
126126 * reports every stored viewport as changed — including one that matches the
127127 * default.
128128 */
129export function isSamePreviewViewport(
129function isSamePreviewViewport(
130130 left: PreviewViewportSetting,
131131 right: PreviewViewportSetting,
132132): boolean {