open-nomad/ui/mirage/factories/policy.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

20 lines
415 B
JavaScript

import { Factory } from 'ember-cli-mirage';
import faker from 'nomad-ui/mirage/faker';
export default Factory.extend({
id: () => faker.hacker.verb(),
name() {
return this.id;
},
description: () => (faker.random.number(10) >= 2 ? faker.lorem.sentence() : null),
rules: `
# Allow read only access to the default namespace
namespace "default" {
policy = "read"
}
node {
policy = "read"
}`,
});