Files
threshold-ui/addons/api/mirage/generated/factories/host-catalog.js
T

23 lines
623 B
JavaScript
Raw Normal View History

2020-06-04 16:53:37 -04:00
import { Factory } from 'ember-cli-mirage';
import { random, date, datatype } from 'faker';
2020-06-04 16:53:37 -04:00
/**
* GeneratedHostCatalogModelFactory
*/
export default Factory.extend({
type: () => random.arrayElement(['static', 'plugin']),
2020-06-04 16:53:37 -04:00
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => datatype.boolean(),
plugin: function (i) {
2022-01-12 15:34:12 -08:00
if (this.type == 'plugin') {
return {
id: `pl_${datatype.hexaDecimal(5)}`,
name: i % 2 ? 'aws' : 'azure',
2022-01-12 15:34:12 -08:00
description: random.words(),
};
}
},
2020-06-04 16:53:37 -04:00
});