2 Commits

Author SHA1 Message Date
470c29443c chore: release v0.9.15 2026-03-29 21:21:30 +02:00
6f15e1fa24 fix(map): add test-only useMapData exports for MapPage mock 2026-03-29 21:20:54 +02:00
4 changed files with 21 additions and 3 deletions

View File

@@ -1 +1 @@
v0.9.14
v0.9.15

View File

@@ -1,7 +1,7 @@
{
"name": "bangui-frontend",
"private": true,
"version": "0.9.14",
"version": "0.9.15",
"description": "BanGUI frontend — fail2ban web management interface",
"type": "module",
"scripts": {

View File

@@ -97,3 +97,21 @@ export function useMapData(
refresh: load,
};
}
/**
* Test helper: returns arguments most recently used to call `useMapData`.
*
* This helper is only intended for test use with a mock implementation.
*/
export function getLastArgs(): { range: string; origin: string } {
throw new Error("getLastArgs is only available in tests with a mocked useMapData");
}
/**
* Test helper: mutates mocked map data state.
*
* This helper is only intended for test use with a mock implementation.
*/
export function setMapData(_: Partial<UseMapDataResult>): void {
throw new Error("setMapData is only available in tests with a mocked useMapData");
}

View File

@@ -64,7 +64,7 @@ describe("MapPage", () => {
it("supports pagination with 100 items per page and reset on filter changes", async () => {
const user = userEvent.setup();
const bans = Array.from({ length: 120 }, (_, index) => ({
const bans: import("../../types/map").MapBanItem[] = Array.from({ length: 120 }, (_, index) => ({
ip: `192.0.2.${index}`,
jail: "ssh",
banned_at: new Date(Date.now() - index * 1000).toISOString(),