28 lines
787 B
TypeScript
28 lines
787 B
TypeScript
import { userFactory } from "../__factories__/user.factory";
|
|
import type { User } from "../entities/models/user";
|
|
|
|
/**
|
|
* Realistic auth seed for dev mode + storybook stories.
|
|
*
|
|
* Built from `userFactory` so factory defaults take care of boring fields
|
|
* and we only override what makes the data look like a real user database.
|
|
*
|
|
* Lazily produced so importing this module is side-effect-free — the
|
|
* factory's sequence counter only advances when a binder calls
|
|
* `buildDevUsers()`.
|
|
*/
|
|
export function buildDevUsers(): User[] {
|
|
return [
|
|
userFactory.build({
|
|
id: "alice",
|
|
username: "alice",
|
|
passwordHash: "hashed_secret_alice",
|
|
}),
|
|
userFactory.build({
|
|
id: "bob",
|
|
username: "bob",
|
|
passwordHash: "hashed_secret_bob",
|
|
}),
|
|
];
|
|
}
|