const { loginUser } = require("../services/auth.service");

test("loginUser wirft Fehler bei falschem Passwort", async () => {
  const fakeDb = {
    query: (_, __, cb) => cb(null, [{
      id: 1,
      username: "test",
      password: "$2b$10$invalid",
      active: 1,
      failed_attempts: 0
    }])
  };

  await expect(
    loginUser(fakeDb, "test", "wrong", 5)
  ).rejects.toBeDefined();
});
