Work around a mirage bug

This commit is contained in:
Michael Lange
2020-05-18 17:04:50 -07:00
parent f760027ccf
commit cb5cea646c

View File

@@ -19,8 +19,11 @@ export default Factory.extend({
return faker.random.number(3);
},
controllersExpected() {
// This property must be read before the conditional
// or Mirage will incorrectly sort dependent properties.
const healthy = this.controllersHealthy;
if (!this.controllerRequired) return 0;
return this.controllersHealthy + faker.random.number({ min: 1, max: 2 });
return healthy + faker.random.number({ min: 1, max: 2 });
},
nodesHealthy: () => faker.random.number(3),