Commit 0f0e70bc authored by Filipa Lacerda's avatar Filipa Lacerda

Reset error state in success mutation to handle error-success state

parent d8fc4012
......@@ -9,6 +9,8 @@ export default {
state.isLoading = true;
},
[types.RECEIVE_REPORTS_SUCCESS](state, response) {
// Make sure to clean previous state in case it was an error
state.hasError = false;
state.isLoading = false;
......
---
title: Renders test reports for resolved failures and resets error state
merge_request:
author:
type: fixed
......@@ -154,7 +154,7 @@ describe('Grouped Test Reports App', () => {
expect(vm.$el.querySelector('.js-mr-code-resolved-issues').textContent).toContain(
resolvedFailures.suites[0].resolved_failures[1].name,
);
done()
done();
}, 0);
});
});
......
......@@ -72,6 +72,10 @@ describe('Reports Store Mutations', () => {
expect(stateCopy.isLoading).toEqual(false);
});
it('should reset hasError', () => {
expect(stateCopy.hasError).toEqual(false);
});
it('should set summary counts', () => {
expect(stateCopy.summary.total).toEqual(mockedResponse.summary.total);
expect(stateCopy.summary.resolved).toEqual(mockedResponse.summary.resolved);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment