mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
35 lines
703 B
TypeScript
35 lines
703 B
TypeScript
import {faker} from '@faker-js/faker'
|
|
|
|
import {Factory} from '../support/factory'
|
|
import {TEST_PASSWORD_HASH} from '../support/constants'
|
|
|
|
export interface UserAttributes {
|
|
id: number | '{increment}';
|
|
username: string;
|
|
password?: string;
|
|
status: number;
|
|
issuer: string;
|
|
language: string;
|
|
created: string;
|
|
updated: string;
|
|
}
|
|
|
|
export class UserFactory extends Factory {
|
|
static table = 'users'
|
|
|
|
static factory() {
|
|
const now = new Date()
|
|
|
|
return {
|
|
id: '{increment}',
|
|
username: faker.string.alphanumeric(10) + faker.string.uuid(),
|
|
password: TEST_PASSWORD_HASH,
|
|
status: 0,
|
|
issuer: 'local',
|
|
language: 'en',
|
|
created: now.toISOString(),
|
|
updated: now.toISOString(),
|
|
}
|
|
}
|
|
}
|