Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(3227): Show download button when the flag is false #1215

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/components/artifact-preview/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
Download
</BsButton>
{{/if}}
{{else}}
<BsButton
@type="primary"
@icon="glyphicon glyphicon-download"
@onClick={{action "download"}}
title="Download current artifact"
>
Download
</BsButton>
{{/if}}
{{#if this.iframeUrl}}
<iframe id={{this.iframeId}} src={{this.iframeUrl}}>
Expand Down
14 changes: 14 additions & 0 deletions tests/integration/components/artifact-preview/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,18 @@ module('Integration | Component | artifact-preview', function (hooks) {
'Alternative content for browsers which do not support iframe'
);
});

test('it renders download all button if DOWNLOAD_ARTIFACT_DIR is true', async function (assert) {
this.set('allowDownloadDir', true);

await render(hbs`<ArtifactPreview @selectedArtifact="/"/>`);
assert.dom('button').includesText('Download All');
});

test('it renders download button if DOWNLOAD_ARTIFACT_DIR is false', async function (assert) {
this.set('allowDownloadDir', false);

await render(hbs`<ArtifactPreview @selectedArtifact="/"/>`);
assert.dom('button').includesText('Download');
});
});