diff options
Diffstat (limited to 'spec/frontend/jobs/store/mutations_spec.js')
-rw-r--r-- | spec/frontend/jobs/store/mutations_spec.js | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/spec/frontend/jobs/store/mutations_spec.js b/spec/frontend/jobs/store/mutations_spec.js index 3557d3b94b6..608abc8f7c4 100644 --- a/spec/frontend/jobs/store/mutations_spec.js +++ b/spec/frontend/jobs/store/mutations_spec.js @@ -76,28 +76,15 @@ describe('Jobs Store Mutations', () => { lines: [], }); - expect(stateCopy.trace).toEqual(html); expect(stateCopy.traceSize).toEqual(511846); expect(stateCopy.isTraceComplete).toEqual(true); }); describe('with new job log', () => { - let stateWithNewLog; - beforeEach(() => { - gon.features = gon.features || {}; - gon.features.jobLogJson = true; - - stateWithNewLog = state(); - }); - - afterEach(() => { - gon.features.jobLogJson = false; - }); - describe('log.lines', () => { describe('when append is true', () => { it('sets the parsed log ', () => { - mutations[types.RECEIVE_TRACE_SUCCESS](stateWithNewLog, { + mutations[types.RECEIVE_TRACE_SUCCESS](stateCopy, { append: true, size: 511846, complete: true, @@ -109,7 +96,7 @@ describe('Jobs Store Mutations', () => { ], }); - expect(stateWithNewLog.trace).toEqual([ + expect(stateCopy.trace).toEqual([ { offset: 1, content: [{ text: 'Running with gitlab-runner 11.12.1 (5a147c92)' }], @@ -121,7 +108,7 @@ describe('Jobs Store Mutations', () => { describe('when it is defined', () => { it('sets the parsed log ', () => { - mutations[types.RECEIVE_TRACE_SUCCESS](stateWithNewLog, { + mutations[types.RECEIVE_TRACE_SUCCESS](stateCopy, { append: false, size: 511846, complete: true, @@ -130,7 +117,7 @@ describe('Jobs Store Mutations', () => { ], }); - expect(stateWithNewLog.trace).toEqual([ + expect(stateCopy.trace).toEqual([ { offset: 0, content: [{ text: 'Running with gitlab-runner 11.11.1 (5a147c92)' }], @@ -142,7 +129,7 @@ describe('Jobs Store Mutations', () => { describe('when it is null', () => { it('sets the default value', () => { - mutations[types.RECEIVE_TRACE_SUCCESS](stateWithNewLog, { + mutations[types.RECEIVE_TRACE_SUCCESS](stateCopy, { append: true, html, size: 511846, @@ -150,7 +137,7 @@ describe('Jobs Store Mutations', () => { lines: null, }); - expect(stateWithNewLog.trace).toEqual([]); + expect(stateCopy.trace).toEqual([]); }); }); }); |