-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13925 from influxdata/fix/download-names
feat(ui): Export and download resource with formatted resource name
- Loading branch information
Showing
6 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {formatDownloadName} from './download' | ||
|
||
describe('formatDownloadName', () => [ | ||
it('formats name correctly', () => { | ||
const name1 = 'My Dashboard ' | ||
const name2 = 'my_dash' | ||
const name3 = 'SystemConfig' | ||
|
||
const expected1 = 'my_dashboard.json' | ||
const expected2 = 'my_dash.json' | ||
const expected3 = 'systemconfig.toml' | ||
|
||
const extension = '.json' | ||
const extension2 = '.toml' | ||
const actual1 = formatDownloadName(name1, extension) | ||
const actual2 = formatDownloadName(name2, extension) | ||
const actual3 = formatDownloadName(name3, extension2) | ||
|
||
expect(actual1).toEqual(expected1) | ||
expect(actual2).toEqual(expected2) | ||
expect(actual3).toEqual(expected3) | ||
}), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters