Correct a test and a dependent key

This commit is contained in:
Michael Lange
2020-02-14 16:44:28 -08:00
parent 4fce8b4a54
commit 6024b9c1b6
3 changed files with 10 additions and 2 deletions

View File

@@ -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;
}),

View File

@@ -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 });

View File

@@ -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) {