Kuba Orlik 651cd48220 Bring the repo up to speed with our recent developments
Summary:
Remove redundant files

User login fixes

Reviewers: #reviewers

Subscribers: jenkins-user

Differential Revision: https://hub.sealcode.org/D1253
2022-07-31 23:01:24 +02:00

40 lines
914 B
TypeScript

import { withProdApp } from "../../test_utils/with-prod-app";
describe("login", () => {
it("displays login form", async () => {
return withProdApp(async ({ rest_api }) => {
const result = await rest_api.get("/logowanie");
const usernameStructure = `
<label for="username">Nazwa użytkownika:</label>
<input
id="username"
type="text"
name="username"
value=""
placeholder="text"
required />`;
const passwordStructure = `
<label for="password">Hasło:</label>
<input
id="password"
type="password"
name="password"
value=""
placeholder="password"
required />`;
if (
!(
result
.replace(/\s/g, "")
.includes(usernameStructure.replace(/\s/g, "")) &&
result
.replace(/\s/g, "")
.includes(passwordStructure.replace(/\s/g, ""))
)
)
throw new Error("Bad html structure!");
});
});
});