mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Correct a test and a dependent key
This commit is contained in:
@@ -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;
|
||||
}),
|
||||
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user