forked from authts/oidc-client-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignoutResponse.test.ts
More file actions
52 lines (39 loc) · 1.58 KB
/
Copy pathSignoutResponse.test.ts
File metadata and controls
52 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
import { describe, it, expect } from "vitest";
import { SignoutResponse } from "./SignoutResponse";
describe("SignoutResponse", () => {
describe("constructor", () => {
it("should read error", () => {
// act
const subject = new SignoutResponse(new URLSearchParams("error=foo"));
// assert
expect(subject.error).toEqual("foo");
});
it("should read error_description", () => {
// act
const subject = new SignoutResponse(new URLSearchParams("error_description=foo"));
// assert
expect(subject.error_description).toEqual("foo");
});
it("should read error_uri", () => {
// act
const subject = new SignoutResponse(new URLSearchParams("error_uri=foo"));
// assert
expect(subject.error_uri).toEqual("foo");
});
it("should read state", () => {
// act
const subject = new SignoutResponse(new URLSearchParams("state=foo"));
// assert
expect(subject.state).toEqual("foo");
});
it("should read url_state", () => {
// act
const subject = new SignoutResponse(new URLSearchParams("state=foo;bar"));
// assert
expect(subject.state).toEqual("foo");
expect(subject.url_state).toEqual("bar");
});
});
});