Commit d225fc56 authored by Lukas Eipert's avatar Lukas Eipert

Vuex: Rename DAST report to diff

For consistency, we rename the action `requestDastReports` and
associated mutations to `requestDastDiff`
parent 82c8a0ba
...@@ -93,7 +93,7 @@ export const updateContainerScanningIssue = ({ commit }, issue) => ...@@ -93,7 +93,7 @@ export const updateContainerScanningIssue = ({ commit }, issue) =>
*/ */
export const setDastDiffEndpoint = ({ commit }, path) => commit(types.SET_DAST_DIFF_ENDPOINT, path); export const setDastDiffEndpoint = ({ commit }, path) => commit(types.SET_DAST_DIFF_ENDPOINT, path);
export const requestDastReports = ({ commit }) => commit(types.REQUEST_DAST_REPORTS); export const requestDastDiff = ({ commit }) => commit(types.REQUEST_DAST_DIFF);
export const updateDastIssue = ({ commit }, issue) => commit(types.UPDATE_DAST_ISSUE, issue); export const updateDastIssue = ({ commit }, issue) => commit(types.UPDATE_DAST_ISSUE, issue);
...@@ -103,7 +103,7 @@ export const receiveDastDiffSuccess = ({ commit }, response) => ...@@ -103,7 +103,7 @@ export const receiveDastDiffSuccess = ({ commit }, response) =>
export const receiveDastDiffError = ({ commit }) => commit(types.RECEIVE_DAST_DIFF_ERROR); export const receiveDastDiffError = ({ commit }) => commit(types.RECEIVE_DAST_DIFF_ERROR);
export const fetchDastDiff = ({ state, dispatch }) => { export const fetchDastDiff = ({ state, dispatch }) => {
dispatch('requestDastReports'); dispatch('requestDastDiff');
return Promise.all([ return Promise.all([
pollUntilComplete(state.dast.paths.diffEndpoint), pollUntilComplete(state.dast.paths.diffEndpoint),
......
...@@ -21,7 +21,7 @@ export const RECEIVE_SAST_CONTAINER_DIFF_ERROR = 'RECEIVE_SAST_CONTAINER_DIFF_ER ...@@ -21,7 +21,7 @@ export const RECEIVE_SAST_CONTAINER_DIFF_ERROR = 'RECEIVE_SAST_CONTAINER_DIFF_ER
// DAST // DAST
export const SET_DAST_DIFF_ENDPOINT = 'SET_DAST_DIFF_ENDPOINT'; export const SET_DAST_DIFF_ENDPOINT = 'SET_DAST_DIFF_ENDPOINT';
export const REQUEST_DAST_REPORTS = 'REQUEST_DAST_REPORTS'; export const REQUEST_DAST_DIFF = 'REQUEST_DAST_DIFF';
export const RECEIVE_DAST_DIFF_SUCCESS = 'RECEIVE_DAST_DIFF_SUCCESS'; export const RECEIVE_DAST_DIFF_SUCCESS = 'RECEIVE_DAST_DIFF_SUCCESS';
export const RECEIVE_DAST_DIFF_ERROR = 'RECEIVE_DAST_DIFF_ERROR'; export const RECEIVE_DAST_DIFF_ERROR = 'RECEIVE_DAST_DIFF_ERROR';
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
Vue.set(state.dast.paths, 'diffEndpoint', path); Vue.set(state.dast.paths, 'diffEndpoint', path);
}, },
[types.REQUEST_DAST_REPORTS](state) { [types.REQUEST_DAST_DIFF](state) {
Vue.set(state.dast, 'isLoading', true); Vue.set(state.dast, 'isLoading', true);
}, },
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
setCanCreateIssuePermission, setCanCreateIssuePermission,
setCanCreateFeedbackPermission, setCanCreateFeedbackPermission,
requestSastContainerReports, requestSastContainerReports,
requestDastReports, requestDastDiff,
requestDependencyScanningReports, requestDependencyScanningReports,
openModal, openModal,
setModalData, setModalData,
...@@ -247,15 +247,15 @@ describe('security reports actions', () => { ...@@ -247,15 +247,15 @@ describe('security reports actions', () => {
}); });
}); });
describe('requestDastReports', () => { describe('requestDastDiff', () => {
it('should commit request mutation', done => { it('should commit request mutation', done => {
testAction( testAction(
requestDastReports, requestDastDiff,
null, null,
mockedState, mockedState,
[ [
{ {
type: types.REQUEST_DAST_REPORTS, type: types.REQUEST_DAST_DIFF,
}, },
], ],
[], [],
...@@ -1484,7 +1484,7 @@ describe('security reports actions', () => { ...@@ -1484,7 +1484,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDastReports', type: 'requestDastDiff',
}, },
{ {
type: 'receiveDastDiffSuccess', type: 'receiveDastDiffSuccess',
...@@ -1517,7 +1517,7 @@ describe('security reports actions', () => { ...@@ -1517,7 +1517,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDastReports', type: 'requestDastDiff',
}, },
{ {
type: 'receiveDastDiffError', type: 'receiveDastDiffError',
...@@ -1546,7 +1546,7 @@ describe('security reports actions', () => { ...@@ -1546,7 +1546,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDastReports', type: 'requestDastDiff',
}, },
{ {
type: 'receiveDastDiffError', type: 'receiveDastDiffError',
......
...@@ -79,9 +79,9 @@ describe('security reports mutations', () => { ...@@ -79,9 +79,9 @@ describe('security reports mutations', () => {
}); });
}); });
describe('REQUEST_DAST_REPORTS', () => { describe('REQUEST_DAST_DIFF', () => {
it('should set dast loading flag to true', () => { it('should set dast loading flag to true', () => {
mutations[types.REQUEST_DAST_REPORTS](stateCopy); mutations[types.REQUEST_DAST_DIFF](stateCopy);
expect(stateCopy.dast.isLoading).toEqual(true); expect(stateCopy.dast.isLoading).toEqual(true);
}); });
......
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