Skip to content

Commit

Permalink
remove spaces between hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jul 28, 2023
1 parent 55e3a8c commit fa463f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libs/fileDownload/FileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function cleanFileName(fileName) {
*/
function appendTimeToFileName(fileName) {
const file = splitExtensionFromFileName(fileName);
let newFileName = `${file.fileName} - ${DateUtils.getDBTime()}`;
let newFileName = `${file.fileName}-${DateUtils.getDBTime()}`;
if (file.fileExtension) {
newFileName += `.${file.fileExtension}`;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/FileUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ describe('FileUtils', () => {
describe('appendTimeToFileName', () => {
it('should append current time to the end of the file name', () => {
const actualFileName = FileUtils.appendTimeToFileName('image.jpg');
const expectedFileName = `image - ${DateUtils.getDBTime()}.jpg`;
const expectedFileName = `image-${DateUtils.getDBTime()}.jpg`;
expect(actualFileName).toEqual(expectedFileName);
});

it('should append current time to the end of the file name without extension', () => {
const actualFileName = FileUtils.appendTimeToFileName('image');
const expectedFileName = `image - ${DateUtils.getDBTime()}`;
const expectedFileName = `image-${DateUtils.getDBTime()}`;
expect(actualFileName).toEqual(expectedFileName);
});
});
Expand Down

0 comments on commit fa463f0

Please sign in to comment.