summaryrefslogtreecommitdiff
path: root/spec/javascripts/ide/stores/actions/file_spec.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-07-26 08:34:05 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-07-26 08:34:05 +0000
commit832dcd6c90a1ca55d8eacd50ba56916e8923b76e (patch)
tree59dd0921be66dcb4b261a9017ac19089618336f8 /spec/javascripts/ide/stores/actions/file_spec.js
parent4fd6b5bc663bcaf1c4f0c9efac12e7110f7a912f (diff)
downloadgitlab-ce-832dcd6c90a1ca55d8eacd50ba56916e8923b76e.tar.gz
Fixed IDE not opening JSON files
Diffstat (limited to 'spec/javascripts/ide/stores/actions/file_spec.js')
-rw-r--r--spec/javascripts/ide/stores/actions/file_spec.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/javascripts/ide/stores/actions/file_spec.js b/spec/javascripts/ide/stores/actions/file_spec.js
index f570c0b16bd..72eb20bdc87 100644
--- a/spec/javascripts/ide/stores/actions/file_spec.js
+++ b/spec/javascripts/ide/stores/actions/file_spec.js
@@ -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();