Skip to content

Commit 97b5019

Browse files
committed
Fix LoginPage test
1 parent 90d900c commit 97b5019

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

site/src/pages/LoginPage/LoginPage.test.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from "../../testHelpers/renderHelpers"
1111
import { server } from "../../testHelpers/server"
1212
import { LoginPage } from "./LoginPage"
13+
import * as TypesGen from "../../api/typesGenerated";
1314

1415
describe("LoginPage", () => {
1516
beforeEach(() => {
@@ -80,15 +81,18 @@ describe("LoginPage", () => {
8081
})
8182

8283
it("shows github authentication when enabled", async () => {
84+
const authMethods: TypesGen.AuthMethods = {
85+
password: { enabled: true, hidden: false },
86+
github: { enabled: true },
87+
oidc: { enabled: true, signInText: "", iconUrl: "" }
88+
};
89+
8390
// Given
8491
server.use(
8592
rest.get("/api/v2/users/authmethods", async (req, res, ctx) => {
8693
return res(
8794
ctx.status(200),
88-
ctx.json({
89-
password: true,
90-
github: true,
91-
}),
95+
ctx.json(authMethods),
9296
)
9397
}),
9498
)

0 commit comments

Comments
 (0)