Skip to content

Commit

Permalink
fix(stories): realistic fileCountInfo mock
Browse files Browse the repository at this point in the history
  • Loading branch information
MellyGray committed Sep 20, 2023
1 parent 3edfaef commit 56b0846
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/component/files/domain/models/FilesCountInfoMother.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,37 @@ import { FileAccessOption, FileTag } from '../../../../../src/files/domain/model

export class FilesCountInfoMother {
static create(props?: Partial<FilesCountInfo>): FilesCountInfo {
const total = props?.total ?? faker.datatype.number()
return {
total: faker.datatype.number(),
perFileType: [
{
type: new FileType(faker.system.fileType()),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
},
{
type: new FileType(faker.system.fileType()),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
}
],
perAccess: [
{
access: faker.helpers.arrayElement(Object.values(FileAccessOption)),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
},
{
access: faker.helpers.arrayElement(Object.values(FileAccessOption)),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
}
],
perFileTag: [
{
tag: new FileTag(faker.lorem.word()),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
},
{
tag: new FileTag(faker.lorem.word()),
count: faker.datatype.number()
count: faker.datatype.number({ max: total })
}
],
...props
Expand Down

0 comments on commit 56b0846

Please sign in to comment.