Commit 48ec35be authored by Lukas Eipert's avatar Lukas Eipert

Vuex: Rename Dependency Scanning report to diff

For consistency, we rename the action `requestDependencyScanningReports`
and associated mutations to `requestDependencyScanningDiff`
parent d225fc56
...@@ -131,8 +131,8 @@ export const fetchDastDiff = ({ state, dispatch }) => { ...@@ -131,8 +131,8 @@ export const fetchDastDiff = ({ state, dispatch }) => {
export const setDependencyScanningDiffEndpoint = ({ commit }, path) => export const setDependencyScanningDiffEndpoint = ({ commit }, path) =>
commit(types.SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT, path); commit(types.SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT, path);
export const requestDependencyScanningReports = ({ commit }) => export const requestDependencyScanningDiff = ({ commit }) =>
commit(types.REQUEST_DEPENDENCY_SCANNING_REPORTS); commit(types.REQUEST_DEPENDENCY_SCANNING_DIFF);
export const receiveDependencyScanningDiffSuccess = ({ commit }, response) => export const receiveDependencyScanningDiffSuccess = ({ commit }, response) =>
commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS, response); commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS, response);
...@@ -141,7 +141,7 @@ export const receiveDependencyScanningDiffError = ({ commit }) => ...@@ -141,7 +141,7 @@ export const receiveDependencyScanningDiffError = ({ commit }) =>
commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR); commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR);
export const fetchDependencyScanningDiff = ({ state, dispatch }) => { export const fetchDependencyScanningDiff = ({ state, dispatch }) => {
dispatch('requestDependencyScanningReports'); dispatch('requestDependencyScanningDiff');
return Promise.all([ return Promise.all([
pollUntilComplete(state.dependencyScanning.paths.diffEndpoint), pollUntilComplete(state.dependencyScanning.paths.diffEndpoint),
......
...@@ -27,7 +27,7 @@ export const RECEIVE_DAST_DIFF_ERROR = 'RECEIVE_DAST_DIFF_ERROR'; ...@@ -27,7 +27,7 @@ export const RECEIVE_DAST_DIFF_ERROR = 'RECEIVE_DAST_DIFF_ERROR';
// DEPENDENCY_SCANNING // DEPENDENCY_SCANNING
export const SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT'; export const SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT';
export const REQUEST_DEPENDENCY_SCANNING_REPORTS = 'REQUEST_DEPENDENCY_SCANNING_REPORTS'; export const REQUEST_DEPENDENCY_SCANNING_DIFF = 'REQUEST_DEPENDENCY_SCANNING_DIFF';
export const RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS = 'RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS'; export const RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS = 'RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS';
export const RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR = 'RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR'; export const RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR = 'RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR';
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
Vue.set(state.dependencyScanning.paths, 'diffEndpoint', path); Vue.set(state.dependencyScanning.paths, 'diffEndpoint', path);
}, },
[types.REQUEST_DEPENDENCY_SCANNING_REPORTS](state) { [types.REQUEST_DEPENDENCY_SCANNING_DIFF](state) {
Vue.set(state.dependencyScanning, 'isLoading', true); Vue.set(state.dependencyScanning, 'isLoading', true);
}, },
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
setCanCreateFeedbackPermission, setCanCreateFeedbackPermission,
requestSastContainerReports, requestSastContainerReports,
requestDastDiff, requestDastDiff,
requestDependencyScanningReports, requestDependencyScanningDiff,
openModal, openModal,
setModalData, setModalData,
requestDismissVulnerability, requestDismissVulnerability,
...@@ -264,15 +264,15 @@ describe('security reports actions', () => { ...@@ -264,15 +264,15 @@ describe('security reports actions', () => {
}); });
}); });
describe('requestDependencyScanningReports', () => { describe('requestDependencyScanningDiff', () => {
it('should commit request mutation', done => { it('should commit request mutation', done => {
testAction( testAction(
requestDependencyScanningReports, requestDependencyScanningDiff,
null, null,
mockedState, mockedState,
[ [
{ {
type: types.REQUEST_DEPENDENCY_SCANNING_REPORTS, type: types.REQUEST_DEPENDENCY_SCANNING_DIFF,
}, },
], ],
[], [],
...@@ -1327,7 +1327,7 @@ describe('security reports actions', () => { ...@@ -1327,7 +1327,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDependencyScanningReports', type: 'requestDependencyScanningDiff',
}, },
{ {
type: 'receiveDependencyScanningDiffSuccess', type: 'receiveDependencyScanningDiffSuccess',
...@@ -1360,7 +1360,7 @@ describe('security reports actions', () => { ...@@ -1360,7 +1360,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDependencyScanningReports', type: 'requestDependencyScanningDiff',
}, },
{ {
type: 'receiveDependencyScanningDiffError', type: 'receiveDependencyScanningDiffError',
...@@ -1389,7 +1389,7 @@ describe('security reports actions', () => { ...@@ -1389,7 +1389,7 @@ describe('security reports actions', () => {
[], [],
[ [
{ {
type: 'requestDependencyScanningReports', type: 'requestDependencyScanningDiff',
}, },
{ {
type: 'receiveDependencyScanningDiffError', type: 'receiveDependencyScanningDiffError',
......
...@@ -87,9 +87,9 @@ describe('security reports mutations', () => { ...@@ -87,9 +87,9 @@ describe('security reports mutations', () => {
}); });
}); });
describe('REQUEST_DEPENDENCY_SCANNING_REPORTS', () => { describe('REQUEST_DEPENDENCY_SCANNING_DIFF', () => {
it('should set dependency scanning loading flag to true', () => { it('should set dependency scanning loading flag to true', () => {
mutations[types.REQUEST_DEPENDENCY_SCANNING_REPORTS](stateCopy); mutations[types.REQUEST_DEPENDENCY_SCANNING_DIFF](stateCopy);
expect(stateCopy.dependencyScanning.isLoading).toEqual(true); expect(stateCopy.dependencyScanning.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