diff --git a/ui/app/models/volume-mount.js b/ui/app/models/volume-mount.js index d30ae4593..402f00d03 100644 --- a/ui/app/models/volume-mount.js +++ b/ui/app/models/volume-mount.js @@ -7,7 +7,7 @@ export default Fragment.extend({ task: fragmentOwner(), volume: attr('string'), - source: computed('task.taskGroup.volumes.@each.{name,source}', function() { + source: computed('volume', 'task.taskGroup.volumes.@each.{name,source}', function() { return this.task.taskGroup.volumes.findBy('name', this.volume).source; }), diff --git a/ui/app/serializers/node.js b/ui/app/serializers/node.js index 1d25e3159..230057eb5 100644 --- a/ui/app/serializers/node.js +++ b/ui/app/serializers/node.js @@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({ }, normalize(modelClass, hash) { - // Transform map-based objects into an array-based fragment lists + // Transform map-based objects into array-based fragment lists const drivers = hash.Drivers || {}; hash.Drivers = Object.keys(drivers).map(key => { return assign({}, drivers[key], { Name: key }); diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js index bbb806d96..5c0834401 100644 --- a/ui/tests/acceptance/client-detail-test.js +++ b/ui/tests/acceptance/client-detail-test.js @@ -905,8 +905,16 @@ module('Acceptance | client detail', function(hooks) { test('the host volumes table lists all host volumes in alphabetical order by name', async function(assert) { await ClientDetail.visit({ id: node.id }); + const sortedHostVolumes = Object.keys(node.hostVolumes) + .map(key => node.hostVolumes[key]) + .sortBy('Name'); + assert.ok(ClientDetail.hasHostVolumes); assert.equal(ClientDetail.hostVolumes.length, Object.keys(node.hostVolumes).length); + + ClientDetail.hostVolumes.forEach((volume, index) => { + assert.equal(volume.name, sortedHostVolumes[index].Name); + }); }); test('each host volume row contains information about the host volume', async function(assert) {