diff options
Diffstat (limited to 'spec/frontend/ide/services')
-rw-r--r-- | spec/frontend/ide/services/index_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend/ide/services/index_spec.js b/spec/frontend/ide/services/index_spec.js index d2c32a81811..e9bdb9197bb 100644 --- a/spec/frontend/ide/services/index_spec.js +++ b/spec/frontend/ide/services/index_spec.js @@ -117,6 +117,21 @@ describe('IDE services', () => { it('sends a request to file.rawPath', () => { return services.getRawFileData(file).then(raw => { + expect(axios.get).toHaveBeenCalledWith(file.rawPath, { + transformResponse: [expect.any(Function)], + }); + expect(raw).toEqual('raw content'); + }); + }); + + it('returns arraybuffer for binary files', () => { + file.binary = true; + + return services.getRawFileData(file).then(raw => { + expect(axios.get).toHaveBeenCalledWith(file.rawPath, { + transformResponse: [expect.any(Function)], + responseType: 'arraybuffer', + }); expect(raw).toEqual('raw content'); }); }); |