Skip to content
Snippets Groups Projects
Commit 832dcd6c authored by Phil Hughes's avatar Phil Hughes Committed by Tim Zallmann
Browse files

Fixed IDE not opening JSON files

parent 4fd6b5bc
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -18,7 +18,7 @@ export default {
 
return axios
.get(file.rawPath, {
params: { format: 'json' },
transformResponse: [f => f],
})
.then(({ data }) => data);
},
Loading
Loading
@@ -33,7 +33,7 @@ export default {
 
return axios
.get(file.rawPath.replace(`/raw/${file.branchId}/${file.path}`, `/raw/${sha}/${file.path}`), {
params: { format: 'json' },
transformResponse: [f => f],
})
.then(({ data }) => data);
},
Loading
Loading
---
title: Fixed IDE not opening JSON files
merge_request: 20798
author:
type: fixed
Loading
Loading
@@ -366,6 +366,23 @@ describe('IDE store file actions', () => {
});
});
 
describe('return JSON', () => {
beforeEach(() => {
mock.onGet(/(.*)/).replyOnce(200, JSON.stringify({ test: '123' }));
});
it('does not parse returned JSON', done => {
store
.dispatch('getRawFileData', { path: tmpFile.path })
.then(() => {
expect(tmpFile.raw).toEqual('{"test":"123"}');
done();
})
.catch(done.fail);
});
});
describe('error', () => {
beforeEach(() => {
mock.onGet(/(.*)/).networkError();
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment