1 | /*
|
2 | * Copyright 2021 Inrupt Inc.
|
3 | *
|
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 | * of this software and associated documentation files (the "Software"), to deal in
|
6 | * the Software without restriction, including without limitation the rights to use,
|
7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
8 | * Software, and to permit persons to whom the Software is furnished to do so,
|
9 | * subject to the following conditions:
|
10 | *
|
11 | * The above copyright notice and this permission notice shall be included in
|
12 | * all copies or substantial portions of the Software.
|
13 | *
|
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20 | */
|
21 |
|
22 | // Required by TSyringe:
|
23 | import "reflect-metadata";
|
24 | import {
|
25 | IOidcHandler,
|
26 | AggregateHandler,
|
27 | } from "@inrupt/solid-client-authn-core";
|
28 | import AggregateOidcHandler from "../../../src/login/oidc/AggregateOidcHandler";
|
29 |
|
30 | jest.mock("@inrupt/solid-client-authn-core");
|
31 |
|
32 | describe("AggregateOidcHandler", () => {
|
33 | it("should pass injected handlers to its superclass", () => {
|
34 | // We just test if the parent is called.
|
35 | // eslint-disable-next-line no-new
|
36 | new AggregateOidcHandler((["Some handler"] as unknown) as IOidcHandler[]);
|
37 |
|
38 | expect((AggregateHandler as jest.Mock).mock.calls).toEqual([
|
39 | [["Some handler"]],
|
40 | ]);
|
41 | });
|
42 | });
|