mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: dedupe ui bootstrap mock reads
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user