|
test("Login in with wrong password for registered user", (done) => { |
|
serverSocket.on("login", (user, pass, email) => { |
|
expect(backend.clientRegister(user, pass, email, db)).toBeTruthy(); |
|
expect(backend.clientLogin(user, "wrongpasswordihope", db)).toBeFalsy(); |
|
done(); |
|
}); |
|
//clientSocket.emit("login", faker.internet.userName(), faker.internet.password(), faker.internet.exampleEmail()); |
|
clientSocket.emit("login", "masterquizzer", "thecorrectpassword", "[email protected]") |
|
}); |
|
|
|
test("Login in with wrong user for registered user", (done) => { |
|
// KΓΆr sjΓ€lv och passar |
|
serverSocket.on("login", (user, pass, email) => { |
|
expect(backend.clientRegister(user, pass, email, db)).toBeTruthy(); |
|
expect(backend.clientLogin("wrongusernameihope", pass, db)).toBeFalsy(); |
|
done(); |
|
}); |
|
///clientSocket.emit("login", faker.internet.userName(), faker.internet.password(), faker.internet.exampleEmail()); |
|
clientSocket.emit("login", "arealuser", "userpassword", "[email protected]") |
|
}); |