From b0c5d48095b5379c2bfb7f2ab129b4ffdfb612a8 Mon Sep 17 00:00:00 2001 From: Daniel Volz Date: Mon, 23 Feb 2026 19:54:18 +0100 Subject: [PATCH] chore: update bug template guidance and include app test changes (#293) --- .github/ISSUE_TEMPLATE/bug_report.yml | 16 +++++ frontend/src/test/App.test.tsx | 86 --------------------------- 2 files changed, 16 insertions(+), 86 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 12293a6..b960376 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,6 +7,10 @@ body: value: | Thanks for taking the time to report a bug! Please fill out the sections below. + Before submitting, please reproduce the issue on the latest released version. + Even better: verify it on the current `main` image/tag. + The issue may already be fixed in newer builds. + - type: textarea id: description attributes: @@ -57,6 +61,18 @@ body: validations: required: true + - type: textarea + id: version_info + attributes: + label: Version / Image Information + description: Provide the app version and, if using Docker, the exact image tag you are running. + placeholder: | + App version (Settings -> About): vX.Y.Z + Docker image tag (if applicable): latest or main + Tag guidance: use `latest` for the newest release, or `main` for the newest changes from the main branch (`main` is always as new as or newer than `latest`). + validations: + required: true + - type: input id: browser attributes: diff --git a/frontend/src/test/App.test.tsx b/frontend/src/test/App.test.tsx index 463a4e7..53508e6 100644 --- a/frontend/src/test/App.test.tsx +++ b/frontend/src/test/App.test.tsx @@ -284,24 +284,6 @@ describe("App", () => { expect(screen.getByText("lightbox-open-med-image.png")).toBeInTheDocument(); }); - it("handles Escape key with modal priority", () => { - appContextMock.scheduleLightboxImage = "med-image.png"; - appContextMock.showImageLightbox = true; - appContextMock.showShareDialog = true; - - render( - - - - ); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - - expect(appContextMock.closeScheduleLightbox).toHaveBeenCalled(); - expect(appContextMock.closeImageLightbox).not.toHaveBeenCalled(); - expect(appContextMock.closeShareDialog).not.toHaveBeenCalled(); - }); - it("handles popstate by closing selected medication", () => { appContextMock.selectedMed = { id: 1, packCount: 1, looseTablets: 0, updatedAt: null }; @@ -344,20 +326,6 @@ describe("App", () => { expect(window.history.pushState).toHaveBeenCalled(); }); - it("Escape key closes about modal via history back", () => { - render( - - - - ); - - fireEvent.click(screen.getByRole("button", { name: "open-about" })); - expect(screen.getByText("about-modal-open")).toBeInTheDocument(); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - expect(window.history.back).toHaveBeenCalled(); - }); - it("handles popstate by resetting share dialog state", () => { appContextMock.showShareDialog = true; @@ -381,47 +349,6 @@ describe("App", () => { expect(screen.getByText("dashboard-page")).toBeInTheDocument(); }); - it("Escape closes refill modal when it is topmost", () => { - appContextMock.showRefillModal = true; - - render( - - - - ); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - expect(appContextMock.closeRefillModal).toHaveBeenCalled(); - }); - - it("Escape closes edit stock modal when it is topmost", () => { - appContextMock.showEditStockModal = true; - - render( - - - - ); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - expect(appContextMock.closeEditStockModal).toHaveBeenCalled(); - }); - - it("Escape closes user filter and medication detail in lower priority", () => { - appContextMock.selectedUser = "Max"; - appContextMock.selectedMed = { id: 1, packCount: 1, looseTablets: 0, updatedAt: null }; - - render( - - - - ); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - expect(appContextMock.closeUserFilter).toHaveBeenCalled(); - expect(appContextMock.closeMedDetail).not.toHaveBeenCalled(); - }); - it("popstate closes image lightbox before other modals", () => { appContextMock.showImageLightbox = true; appContextMock.scheduleLightboxImage = "img.png"; @@ -450,17 +377,4 @@ describe("App", () => { window.dispatchEvent(new PopStateEvent("popstate")); expect(appContextMock.setScheduleLightboxImage).toHaveBeenCalledWith(null); }); - - it("Escape closes medication detail when no higher-priority modal is open", () => { - appContextMock.selectedMed = { id: 1, packCount: 1, looseTablets: 0, updatedAt: null }; - - render( - - - - ); - - document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" })); - expect(appContextMock.closeMedDetail).toHaveBeenCalled(); - }); });