open-nomad/ui/mirage/factories/task-group-scale.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
521 B
JavaScript
Raw Normal View History

2020-07-25 04:36:43 +00:00
import { Factory, trait } from 'ember-cli-mirage';
import faker from 'nomad-ui/mirage/faker';
export default Factory.extend({
name() {
return this.id;
},
2020-07-25 04:36:43 +00:00
desired: 1,
placed: 1,
running: 1,
healthy: 1,
unhealthy: 1,
shallow: false,
afterCreate(taskGroupScale, server) {
if (!taskGroupScale.shallow) {
const events = server.createList('scale-event', faker.random.number({ min: 1, max: 10 }));
taskGroupScale.update({
eventIds: events.mapBy('id'),
});
}
},
});