From 54f5b294edcbcd7a9a39850dada0c8f78c5866bf Mon Sep 17 00:00:00 2001 From: Phil Rzewski Date: Fri, 24 May 2024 17:11:28 +0000 Subject: [PATCH] Make the release notes test flexible to repo changes (#3075) --- apps/zui/src/app/release-notes/test.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/zui/src/app/release-notes/test.tsx b/apps/zui/src/app/release-notes/test.tsx index 5639a701e4..aa9df9c774 100644 --- a/apps/zui/src/app/release-notes/test.tsx +++ b/apps/zui/src/app/release-notes/test.tsx @@ -7,16 +7,17 @@ import {rest} from "msw" import {SystemTest} from "src/test/system" import ReleaseNotes from "./release-notes" import {screen} from "@testing-library/react" +import pkg from "../../../package.json" const system = new SystemTest("release-notes") +const url = + pkg.repository.replace("github.com", "api.github.com/repos") + + "/releases/tags/v0.0.0" system.network.use( - rest.get( - "https://api.github.com/repos/brimdata/zui/releases/tags/v0.0.0", - (req, res, ctx) => { - return res(ctx.status(200), ctx.json({body: "Testing Release Notes"})) - } - ) + rest.get(url, (req, res, ctx) => { + return res(ctx.status(200), ctx.json({body: "Testing Release Notes"})) + }) ) test("fetches the release notes", async () => {