Skip to content

Commit

Permalink
fix test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Nov 25, 2020
1 parent 3774f7c commit 1b5c81c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ui/tests/acceptance/volumes-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ module('Acceptance | volumes list', function(hooks) {

const volumeRow = VolumesList.volumes.objectAt(0);

const controllerHealthStr = volume.controllersHealthy > 0 ?
`Healthy (${volume.controllersHealthy}/${volume.controllersExpected})` :
volume.controllerRequired ?
'Unhealthy (${volume.controllersHealthy}/${volume.controllersExpected})' :
'Node Only';
let controllerHealthStr = 'Node Only';
if (volume.controllerRequired || volume.controllersExpected > 0) {
const healthy = volume.controllersHealthy;
const expected = volume.controllersExpected;
const isHealthy = healthy > 0;
controllerHealthStr = `${isHealthy ? 'Healthy' : 'Unhealthy'} (${healthy}/${expected})`;
}

const nodeHealthStr = volume.nodesHealthy > 0 ? 'Healthy' : 'Unhealthy';

assert.equal(volumeRow.name, volume.id);
assert.equal(volumeRow.schedulable, volume.schedulable ? 'Schedulable' : 'Unschedulable');
assert.equal(volumeRow.controllerHealth, `${controllerHealthStr}`);
assert.equal(volumeRow.controllerHealth, controllerHealthStr);
assert.equal(
volumeRow.nodeHealth,
`${nodeHealthStr} (${volume.nodesHealthy}/${volume.nodesExpected})`
Expand Down

0 comments on commit 1b5c81c

Please sign in to comment.