Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
swetapadmanabhan committed Mar 7, 2024
1 parent e69cd50 commit 1d0615a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,31 @@ describe("Session", () => {
return expect((await headers).get("X-Test-Header")).toEqual("test");
});

it("Should allow api option header based on ensureSerializableResponse", async () => {
const headers = new Promise<Headers>((resolve) => {
server.use(
http.post(
"http://ftrack.test/api",
(info) => {
resolve(info.request.headers as any);
return HttpResponse.json(getInitialSessionQuery());
},
{ once: true },
),
);
});

new Session(
credentials.serverUrl,
credentials.apiUser,
credentials.apiKey,
{
ensureSerializableResponse: false,
},
);
return expect((await headers).get("ftrack-api-options")).toBeFalsy();
});

it("Should allow creating a User", () => {
const promise = session.create("User", {
username: getTestUsername(),
Expand Down

0 comments on commit 1d0615a

Please sign in to comment.