open-nomad/ui/mirage/factories/task.js
Michael Lange b9d590349e Dasherize task names in factory
This is to avoid test failures due to url encoding mismatches
2018-06-13 15:04:31 -07:00

17 lines
431 B
JavaScript

import { Factory, faker } from 'ember-cli-mirage';
import { generateResources } from '../common';
const DRIVERS = ['docker', 'java', 'rkt', 'qemu', 'exec', 'raw_exec'];
export default Factory.extend({
// Hidden property used to compute the Summary hash
groupNames: [],
JobID: '',
name: id => `task-${faker.hacker.noun().dasherize()}-${id}`,
driver: faker.list.random(...DRIVERS),
Resources: generateResources,
});