refactor: strip Phase/Plan/R-number references from source comments
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { ZodError } from "zod";
|
||||
import { signInUseCase, signInOutputSchema } from "@/application/use-cases/sign-in.use-case";
|
||||
import {
|
||||
signInUseCase,
|
||||
signInOutputSchema,
|
||||
} from "@/application/use-cases/sign-in.use-case";
|
||||
import { MockUsersRepository } from "@/infrastructure/repositories/users.repository.mock";
|
||||
import { MockAuthenticationService } from "@/infrastructure/services/authentication.service.mock";
|
||||
import { AuthenticationError } from "@/entities/errors/auth";
|
||||
@@ -18,7 +21,10 @@ describe("signInUseCase", () => {
|
||||
await users.createUser(seedUser);
|
||||
|
||||
const useCase = signInUseCase(users, auth);
|
||||
const result = await useCase({ username: "alice", password: "testpassword" });
|
||||
const result = await useCase({
|
||||
username: "alice",
|
||||
password: "testpassword",
|
||||
});
|
||||
|
||||
expect(result.session.userId).toBe(seedUser.id);
|
||||
expect(result.cookie.name).toBe("session");
|
||||
@@ -38,7 +44,10 @@ describe("signInUseCase", () => {
|
||||
const users = new MockUsersRepository([]);
|
||||
const auth = new MockAuthenticationService(users);
|
||||
await users.createUser(
|
||||
userFactory.build({ username: "alice", passwordHash: "hashed_correctpassword" }),
|
||||
userFactory.build({
|
||||
username: "alice",
|
||||
passwordHash: "hashed_correctpassword",
|
||||
}),
|
||||
);
|
||||
|
||||
const useCase = signInUseCase(users, auth);
|
||||
@@ -48,7 +57,7 @@ describe("signInUseCase", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("signInUseCase output validation (R25)", () => {
|
||||
describe("signInUseCase output validation", () => {
|
||||
it("throws when authenticationService returns a malformed session", async () => {
|
||||
const users = new MockUsersRepository([]);
|
||||
const seed = userFactory.build({ username: "alice" });
|
||||
@@ -61,7 +70,9 @@ describe("signInUseCase output validation (R25)", () => {
|
||||
} as unknown as IAuthenticationService;
|
||||
|
||||
const useCase = signInUseCase(users, auth);
|
||||
await expect(useCase({ username: "alice", password: "x" })).rejects.toBeInstanceOf(ZodError);
|
||||
await expect(
|
||||
useCase({ username: "alice", password: "x" }),
|
||||
).rejects.toBeInstanceOf(ZodError);
|
||||
});
|
||||
|
||||
it("exports an output schema that mirrors the success shape", () => {
|
||||
|
||||
Reference in New Issue
Block a user