test: dedupe ui bootstrap mock reads

This commit is contained in:
Peter Steinberger
2026-05-13 04:20:35 +01:00
parent d534c15b0a
commit 47f31dd15d

View File

@@ -316,14 +316,10 @@ describe("loadControlUiBootstrapConfig", () => {
await loadControlUiBootstrapConfig(state);
expect(fetchMock).toHaveBeenCalledTimes(2);
const [, firstInit] = fetchMock.mock.calls.at(0) ?? [];
const [, secondInit] = fetchMock.mock.calls.at(1) ?? [];
expect((firstInit?.headers as Record<string, string> | undefined)?.Authorization).toBe(
"Bearer stale-token",
);
expect((secondInit?.headers as Record<string, string> | undefined)?.Authorization).toBe(
"Bearer fresh-password",
);
const firstFetchCall = requireFetchCall(fetchMock, 0);
const secondFetchCall = requireFetchCall(fetchMock, 1);
expect(firstFetchCall.headers.Authorization).toBe("Bearer stale-token");
expect(secondFetchCall.headers.Authorization).toBe("Bearer fresh-password");
expect(state.assistantName).toBe("Ops");
expect(state.serverVersion).toBe("2026.4.22");