From cb5cea646ca5a287535c8a30a2ee395d8549e13d Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Mon, 18 May 2020 17:04:50 -0700 Subject: [PATCH] Work around a mirage bug --- ui/mirage/factories/csi-plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/mirage/factories/csi-plugin.js b/ui/mirage/factories/csi-plugin.js index 828ab2b7b..6e4622679 100644 --- a/ui/mirage/factories/csi-plugin.js +++ b/ui/mirage/factories/csi-plugin.js @@ -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),