Skip to content

Commit e5c630b

Browse files
committed
add test for no app-name set and check in title too
Signed-off-by: niwla23 <[email protected]>
1 parent 01f8060 commit e5c630b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/unit/node/routes/login.test.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,20 @@ describe("login", () => {
101101

102102
const htmlContent = await resp.text()
103103
expect(resp.status).toBe(200)
104-
expect(htmlContent).toContain(appName)
104+
expect(htmlContent).toContain(`${appName}</h1>`)
105+
expect(htmlContent).toContain(`<title>${appName} login</title>`)
106+
})
107+
108+
it("should return correct app-name when unset", async () => {
109+
process.env.PASSWORD = previousEnvPassword
110+
const appName = "code-server"
111+
const codeServer = await integration.setup([], "")
112+
const resp = await codeServer.fetch("/login", { method: "GET" })
113+
114+
const htmlContent = await resp.text()
115+
expect(resp.status).toBe(200)
116+
expect(htmlContent).toContain(`${appName}</h1>`)
117+
expect(htmlContent).toContain(`<title>${appName} login</title>`)
105118
})
106119

107120
it("should return correct welcome text", async () => {

0 commit comments

Comments
 (0)