Skip to content

Commit

Permalink
adds pr review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akolson committed Sep 7, 2022
1 parent c491ac0 commit b9f89e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
},
formattedFileDisplay() {
const fileName = this.fileDisplay.original_filename;
if (fileName === 'file' || (fileName && !fileName.length)) {
if (fileName === 'file' || !fileName) {
return this.$tr('unknownFile');
}
return fileName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ describe('fileUploadItem', () => {
describe('render', () => {
it("'Unknown filename' should be displayed if original_filename is 'file'", () => {
let file = {
id: 'file-1',
original_filename: 'file',
};
let wrapper = makeWrapper({}, file);
expect(wrapper.find('[data-test="file-link"]').text()).toBe('Unknown filename');
});
it("'Unknown filename' should be displayed if original_filename is ''", () => {
let file = {
original_filename: '',
};
let wrapper = makeWrapper({}, file);
expect(wrapper.find('[data-test="file-link"]').text()).toBe('Unknown filename');
});
it("original_filename should be displayed if its value is not 'file'", () => {
let file = {
id: 'file-1',
Expand Down

0 comments on commit b9f89e9

Please sign in to comment.