diff options
Diffstat (limited to 'spec/frontend/releases/stores/modules/detail/mutations_spec.js')
-rw-r--r-- | spec/frontend/releases/stores/modules/detail/mutations_spec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/frontend/releases/stores/modules/detail/mutations_spec.js b/spec/frontend/releases/stores/modules/detail/mutations_spec.js index 944769d22cc..bf40af9a897 100644 --- a/spec/frontend/releases/stores/modules/detail/mutations_spec.js +++ b/spec/frontend/releases/stores/modules/detail/mutations_spec.js @@ -89,6 +89,15 @@ describe('Release edit/new mutations', () => { expect(state.release.tagName).toBe(newTag); }); + + it('nulls out existing release', () => { + state.release = release; + state.existingRelease = release; + const newTag = 'updated-tag-name'; + mutations[types.UPDATE_RELEASE_TAG_NAME](state, newTag); + + expect(state.existingRelease).toBe(null); + }); }); describe(`${types.UPDATE_RELEASE_TAG_MESSAGE}`, () => { @@ -304,6 +313,17 @@ describe('Release edit/new mutations', () => { expect(state.tagNotes).toBe(''); expect(state.isFetchingTagNotes).toBe(false); }); + + it('nulls out existing release', () => { + state.existingRelease = release; + const message = 'there was an error'; + state.isFetchingTagNotes = true; + state.tagNotes = 'tag notes'; + + mutations[types.RECEIVE_TAG_NOTES_ERROR](state, { message }); + + expect(state.existingRelease).toBe(null); + }); }); describe(`${types.UPDATE_INCLUDE_TAG_NOTES}`, () => { it('sets whether or not to include the tag notes', () => { |