diff --git a/app/components/file-table.js b/app/components/file-table.js
index 38ca04c..830d03c 100644
--- a/app/components/file-table.js
+++ b/app/components/file-table.js
@@ -15,6 +15,12 @@ export default Component.extend({
} else return this.selectedFilePaths.length === 0 ? 'none' : 'some';
}),
+ selectedFileDownloads: computed('selectedFilePaths.[]', 'files.@each.{status,path}', function() {
+ return this.selectedFilePaths.map(path => {
+ return this.files.find(file => file.status === 'available' && file.path === path);
+ })
+ }),
+
actions: {
downloadSelected() {
set(this, 'showDownloadAlert', true);
diff --git a/app/templates/components/file-table.hbs b/app/templates/components/file-table.hbs
index e2f99fe..569407a 100644
--- a/app/templates/components/file-table.hbs
+++ b/app/templates/components/file-table.hbs
@@ -9,7 +9,11 @@
>
Close
- Foo
+
+ {{#each selectedFileDownloads as | file |}}
+ - {{file.device}}:
{{file.path}}
+ {{/each}}
+
{{/if}}
diff --git a/tests/integration/components/file-table-test.js b/tests/integration/components/file-table-test.js
index 76624f5..ddbb7de 100644
--- a/tests/integration/components/file-table-test.js
+++ b/tests/integration/components/file-table-test.js
@@ -90,11 +90,15 @@ module('Integration | Component | file-table', function(hooks) {
test('it handles showing download device/path for selected available files', async function(assert) {
this.set('files', [genericFile(), genericFile()]);
+ this.set('files.1.status', 'scheduled');
await render(hbs`{{file-table files=files}}`);
await click('[data-test-action=file-table-select-all]');
await click('[data-test-action=file-table-download-selected]');
assert.ok(find('[data-test-id=file-table-download-alert]'), 'Renders download alert wrapper');
+ assert.equal(find('[data-test-id=file-table-download-alert]').innerText.includes(this.files[0].device), true, 'Renders first file device');
+ assert.equal(find('[data-test-id=file-table-download-alert]').innerText.includes(this.files[0].path), true, 'Renders first file path');
+ assert.equal(find('[data-test-id=file-table-download-alert]').innerText.includes(this.files[1].path), false, 'Does NOT render second file path');
await click('[data-test-action=file-table-download-close]');
assert.notOk(find('[data-test-id=file-table-download-alert]'), 'Closes download alert wrapper');