mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that if the delimiter is set other than comma then download the file as '.txt' file. Fixes #4573
This commit is contained in:
committed by
Akshay Joshi
parent
52d031f2d0
commit
8bdfa18efb
@@ -298,13 +298,22 @@ describe('queryToolActions', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
it('calls trigger_csv_download with the query and the filename', () => {
|
||||
it('calls trigger_csv_download with the query and the filename with .csv extension', () => {
|
||||
let filename = 'data-' + time + '.csv';
|
||||
|
||||
queryToolActions.download(sqlEditorController);
|
||||
|
||||
expect(sqlEditorController.trigger_csv_download).toHaveBeenCalledWith(selectedQueryString, filename);
|
||||
});
|
||||
|
||||
it('calls trigger_csv_download with the query and the filename with .txt extension', () => {
|
||||
sqlEditorController.preferences.csv_field_separator = ';';
|
||||
let filename = 'data-' + time + '.txt';
|
||||
|
||||
queryToolActions.download(sqlEditorController);
|
||||
|
||||
expect(sqlEditorController.trigger_csv_download).toHaveBeenCalledWith(selectedQueryString, filename);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when there is no selection', () => {
|
||||
@@ -622,6 +631,9 @@ describe('queryToolActions', () => {
|
||||
table_name: 'iAmATable',
|
||||
is_query_tool: true,
|
||||
check_data_changes_to_execute_query: jasmine.createSpy('check_data_changes_to_execute_query'),
|
||||
preferences: {
|
||||
csv_field_separator: ',',
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user