From 6124a94d6955ef47586ea3623a37bf0211f8e7c4 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Sun, 5 Apr 2026 13:52:40 +0200 Subject: [PATCH] fix(web): make FileViewer skeleton widths deterministic Replace Math.random() with a deterministic formula so snapshot tests don't flake on every run. Co-Authored-By: Claude Opus 4.6 (1M context) --- webui2/src/components/code/FileViewer.tsx | 2 +- .../__snapshots__/FileViewer.test.tsx.snap | 40 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/webui2/src/components/code/FileViewer.tsx b/webui2/src/components/code/FileViewer.tsx index 4c6518990108edb08118830aa95d3a70ec766403..88317cd10d64b0d942479d89f1848c1d6c50b273 100644 --- a/webui2/src/components/code/FileViewer.tsx +++ b/webui2/src/components/code/FileViewer.tsx @@ -121,7 +121,7 @@ function FileViewerSkeleton() {
{Array.from({ length: 20 }).map((_, i) => ( - + ))}
diff --git a/webui2/src/components/code/__snapshots__/FileViewer.test.tsx.snap b/webui2/src/components/code/__snapshots__/FileViewer.test.tsx.snap index 66831c82bf6959cfc81023f4062d75e770fb0156..222be18d9d9b2f7204fc1b4706a4175e0a2fe685 100644 --- a/webui2/src/components/code/__snapshots__/FileViewer.test.tsx.snap +++ b/webui2/src/components/code/__snapshots__/FileViewer.test.tsx.snap @@ -261,83 +261,83 @@ exports[`FileViewer/TypeScriptFile matches snapshot 1`] = ` >