diff --git a/.changelog/unreleased/626-changelog-foundations.md b/.changelog/unreleased/626-changelog-foundations.md new file mode 100644 index 00000000..6f38fe22 --- /dev/null +++ b/.changelog/unreleased/626-changelog-foundations.md @@ -0,0 +1,8 @@ +--- +type: added +area: internal +pr: 626 +breaking: false +--- + +The changelog now has stable release links, semantic category badges, and an on-request what's-new summary from the application navbar. diff --git a/apps/web/src/features/changelog/changelog.search.test.tsx b/apps/web/src/features/changelog/changelog.search.test.tsx index 8fe58fa8..a5f44cea 100644 --- a/apps/web/src/features/changelog/changelog.search.test.tsx +++ b/apps/web/src/features/changelog/changelog.search.test.tsx @@ -1,7 +1,6 @@ -import { describe, it, expect } from "vitest" -import { render, screen, waitFor } from "@testing-library/react" -import userEvent from "@testing-library/user-event" -import { highlightMatches, findMatches, matchesQuery } from "./utils.search" +import { describe, expect, it } from "vitest" +import { render } from "@testing-library/react" +import { findMatches, highlightMatches, matchesQuery } from "./utils.search" import { HighlightedText } from "./components/HighlightedText" describe("Search utilities", () => { @@ -80,9 +79,7 @@ describe("Search utilities", () => { describe("HighlightedText component", () => { it("renders text without highlighting when no query", () => { - const { container } = render( - - ) + const { container } = render() expect(container.textContent).toBe("hello world") }) @@ -129,15 +126,25 @@ describe("HighlightedText component", () => { describe("Search in changelog context", () => { it("composes search with other filters", () => { const entries = [ - { type: "added" as const, area: "trade" as const, text: "Trigger orders", pr: 1, breaking: false }, - { type: "fixed" as const, area: "pools" as const, text: "Pool APY calculation", pr: 2, breaking: false }, + { + type: "added" as const, + area: "trade" as const, + text: "Trigger orders", + pr: 1, + breaking: false, + }, + { + type: "fixed" as const, + area: "pools" as const, + text: "Pool APY calculation", + pr: 2, + breaking: false, + }, ] // Filter by type AND search const filtered = entries.filter( - (e) => - e.type === "added" && - matchesQuery(e.text, "trigger") + (e) => e.type === "added" && matchesQuery(e.text, "trigger") ) expect(filtered).toHaveLength(1) diff --git a/apps/web/src/features/changelog/changelog.test.tsx b/apps/web/src/features/changelog/changelog.test.tsx index 60d82d1b..483c2cae 100644 --- a/apps/web/src/features/changelog/changelog.test.tsx +++ b/apps/web/src/features/changelog/changelog.test.tsx @@ -1,9 +1,14 @@ -import { describe, it, expect, vi, beforeAll, afterEach, afterAll } from "vitest" +import { beforeEach, describe, expect, it, vi } from "vitest" import { render, screen, waitFor } from "@testing-library/react" import userEvent from "@testing-library/user-event" -import { http, HttpResponse } from "msw" -import { setupServer } from "msw/node" +import { QueryClient, QueryClientProvider } from "@tanstack/react-query" +import { HttpResponse, http } from "msw" import { ChangelogPage } from "./components/ChangelogPage" +import { server } from "@/test/msw/server" + +vi.mock("@/ui/Navbar", () => ({ + Navbar: () =>