Skip to content

Commit a03efdf

Browse files
committed
test: add test to deleteCookie
1 parent bc32b34 commit a03efdf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

core/deleteCookie.test.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, mock, test } from "bun:test";
2+
import { type DeepPartial, baseMockClient, mockCookie } from "@/__test__/const";
3+
import type { OidcClient } from "@/core/OidcClient";
4+
import { defaultCookieSettings } from "./const";
5+
import { deleteCookie } from "./deleteCookie";
6+
7+
describe("Unit/core/deleteCookie", () => {
8+
test("Default", () => {
9+
const ms = {
10+
...baseMockClient,
11+
logger: {
12+
trace: mock(),
13+
debug: mock(),
14+
},
15+
} as DeepPartial<OidcClient> as OidcClient;
16+
17+
deleteCookie(ms, mockCookie);
18+
19+
expect(ms.logger?.trace).toHaveBeenCalled();
20+
expect(ms.logger?.debug).toHaveBeenCalled();
21+
expect(
22+
mockCookie[defaultCookieSettings.sessionIdName].update,
23+
).toHaveBeenCalled();
24+
});
25+
});

0 commit comments

Comments
 (0)