open-nomad/ui/mirage/factories/node-event.js
Buck Doyle 5da134d074
UI: Change Mirage data to be stable in development (#6389)
This sets a default-but-query-configurable Faker seed in development,
via faker-seed. It also changes uses of Math.random to use Faker’s
randomness so auto-generated data remains stable in development.
2019-10-03 09:13:08 -05:00

14 lines
419 B
JavaScript

import { Factory } from 'ember-cli-mirage';
import faker from 'nomad-ui/mirage/faker';
import { provide } from '../utils';
const REF_TIME = new Date();
const STATES = provide(10, faker.system.fileExt.bind(faker.system));
export default Factory.extend({
subsystem: () => faker.helpers.randomize(STATES),
message: () => faker.lorem.sentence(),
time: () => faker.date.past(2 / 365, REF_TIME),
details: null,
});