Commit fb429646 authored by mfluharty's avatar mfluharty

Review feedback changes

Pass caught error to receiveReportsError
Expect error to be passed in fetchReports spec
camelCase feature flag name in spec name
parent 2827e94f
...@@ -29,7 +29,7 @@ export const fetchReports = ({ state, dispatch, commit }, diffFeatureFlagEnabled ...@@ -29,7 +29,7 @@ export const fetchReports = ({ state, dispatch, commit }, diffFeatureFlagEnabled
), ),
) )
.then((data) => dispatch('receiveReportsSuccess', data)) .then((data) => dispatch('receiveReportsSuccess', data))
.catch(() => dispatch('receiveReportsError')); .catch((error) => dispatch('receiveReportsError', error));
}; };
export const receiveReportsSuccess = ({ commit }, data) => { export const receiveReportsSuccess = ({ commit }, data) => {
......
...@@ -65,7 +65,7 @@ describe('Codequality Reports actions', () => { ...@@ -65,7 +65,7 @@ describe('Codequality Reports actions', () => {
let mock; let mock;
let diffFeatureFlagEnabled; let diffFeatureFlagEnabled;
describe('with :codequality_mr_diff feature flag enabled', () => { describe('with codequalityMrDiff feature flag enabled', () => {
beforeEach(() => { beforeEach(() => {
diffFeatureFlagEnabled = true; diffFeatureFlagEnabled = true;
localState.reportsPath = `${TEST_HOST}/codequality_reports.json`; localState.reportsPath = `${TEST_HOST}/codequality_reports.json`;
...@@ -112,7 +112,7 @@ describe('Codequality Reports actions', () => { ...@@ -112,7 +112,7 @@ describe('Codequality Reports actions', () => {
}); });
}); });
describe('with :codequality_mr_diff feature flag disabled', () => { describe('with codequalityMrDiff feature flag disabled', () => {
beforeEach(() => { beforeEach(() => {
diffFeatureFlagEnabled = false; diffFeatureFlagEnabled = false;
localState.headPath = `${TEST_HOST}/head.json`; localState.headPath = `${TEST_HOST}/head.json`;
...@@ -157,7 +157,7 @@ describe('Codequality Reports actions', () => { ...@@ -157,7 +157,7 @@ describe('Codequality Reports actions', () => {
diffFeatureFlagEnabled, diffFeatureFlagEnabled,
localState, localState,
[{ type: types.REQUEST_REPORTS }], [{ type: types.REQUEST_REPORTS }],
[{ type: 'receiveReportsError' }], [{ type: 'receiveReportsError', payload: expect.any(Error) }],
done, done,
); );
}); });
......
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