Refactor service status response: migrate bangui_version into version field

This commit is contained in:
2026-03-22 21:42:08 +01:00
parent ed184f1c84
commit 798ed08ddd
15 changed files with 27 additions and 68 deletions

View File

@@ -41,7 +41,6 @@ describe("ServerStatusBar", () => {
it("shows a spinner while the initial load is in progress", () => {
mockedUseServerStatus.mockReturnValue({
status: null,
banguiVersion: null,
loading: true,
error: null,
refresh: vi.fn(),
@@ -60,7 +59,6 @@ describe("ServerStatusBar", () => {
total_bans: 10,
total_failures: 5,
},
banguiVersion: "1.1.0",
loading: false,
error: null,
refresh: vi.fn(),
@@ -78,7 +76,6 @@ describe("ServerStatusBar", () => {
total_bans: 0,
total_failures: 0,
},
banguiVersion: "1.1.0",
loading: false,
error: null,
refresh: vi.fn(),
@@ -96,7 +93,6 @@ describe("ServerStatusBar", () => {
total_bans: 0,
total_failures: 0,
},
banguiVersion: "1.2.3",
loading: false,
error: null,
refresh: vi.fn(),
@@ -105,7 +101,7 @@ describe("ServerStatusBar", () => {
expect(screen.getByText("v1.2.3")).toBeInTheDocument();
});
it("renders a BanGUI version badge", () => {
it("does not render a separate BanGUI version badge", () => {
mockedUseServerStatus.mockReturnValue({
status: {
online: true,
@@ -114,13 +110,12 @@ describe("ServerStatusBar", () => {
total_bans: 0,
total_failures: 0,
},
banguiVersion: "9.9.9",
loading: false,
error: null,
refresh: vi.fn(),
});
renderBar();
expect(screen.getByText("BanGUI v9.9.9")).toBeInTheDocument();
expect(screen.queryByText("BanGUI v9.9.9")).toBeNull();
});
it("does not render the version element when version is null", () => {
@@ -132,7 +127,6 @@ describe("ServerStatusBar", () => {
total_bans: 0,
total_failures: 0,
},
banguiVersion: "1.2.3",
loading: false,
error: null,
refresh: vi.fn(),
@@ -151,7 +145,6 @@ describe("ServerStatusBar", () => {
total_bans: 21,
total_failures: 99,
},
banguiVersion: "1.0.0",
loading: false,
error: null,
refresh: vi.fn(),
@@ -167,7 +160,6 @@ describe("ServerStatusBar", () => {
it("renders an error message when the status fetch fails", () => {
mockedUseServerStatus.mockReturnValue({
status: null,
banguiVersion: null,
loading: false,
error: "Network error",
refresh: vi.fn(),