From f58c0a173b5d89973dceb807ffe465c7d397f88a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 21:22:27 +0000 Subject: [PATCH] I'm fixing the CI lint and test failures. - Refactoring `scripts/check-hex.js` to use git's native search instead of `ripgrep` for better portability and dependency reduction. - Updating `tests/ui/uploadModal-integration.test.mjs` to ensure DOM isolation between tests using `beforeEach` cleanup, resolving state pollution issues. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- scripts/check-hex.js | 75 +++++++++++++---------- tests/ui/uploadModal-integration.test.mjs | 20 +++--- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/scripts/check-hex.js b/scripts/check-hex.js index cad3d23d..3874779d 100755 --- a/scripts/check-hex.js +++ b/scripts/check-hex.js @@ -8,54 +8,61 @@ import { spawnSync } from "node:child_process"; const SEARCH_PATTERN = '(? { if (dom) dom.cleanup(); }); + beforeEach(() => { + // Ensure clean DOM state + if (global.document && global.document.body) { + global.document.body.innerHTML = ''; + } + }); + it("should detect default R2 connection and show summary when loaded and unlocked", async () => { // Setup Mock Data const pubkey = "pk1"; @@ -170,13 +177,10 @@ describe("UploadModal Integration", () => { meta: { bucket: "locked-bucket" } }]; - // Setup DOM - Reuse existing container or create if missing (cleaned by load) - let container = document.getElementById("modalContainer"); - if (!container) { - container = document.createElement("div"); - container.id = "modalContainer"; - document.body.appendChild(container); - } + // Setup DOM - Create new container + const container = document.createElement("div"); + container.id = "modalContainer"; + document.body.appendChild(container); // Re-instantiate const modal = new UploadModal({