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 }) => {
export const setDependencyScanningDiffEndpoint = ({ commit }, path) =>
commit(types.SET_DEPENDENCY_SCANNING_DIFF_ENDPOINT, path);
export const requestDependencyScanningReports = ({ commit }) =>
commit(types.REQUEST_DEPENDENCY_SCANNING_REPORTS);
export const requestDependencyScanningDiff = ({ commit }) =>
commit(types.REQUEST_DEPENDENCY_SCANNING_DIFF);
export const receiveDependencyScanningDiffSuccess = ({ commit }, response) =>
commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS, response);
......@@ -141,7 +141,7 @@ export const receiveDependencyScanningDiffError = ({ commit }) =>
commit(types.RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR);
export const fetchDependencyScanningDiff = ({ state, dispatch }) => {
dispatch('requestDependencyScanningReports');
dispatch('requestDependencyScanningDiff');
return Promise.all([
pollUntilComplete(state.dependencyScanning.paths.diffEndpoint),
......
......@@ -27,7 +27,7 @@ export const RECEIVE_DAST_DIFF_ERROR = 'RECEIVE_DAST_DIFF_ERROR';
// DEPENDENCY_SCANNING
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_ERROR = 'RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR';
......
......@@ -110,7 +110,7 @@ export default {
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);
},
......
......@@ -9,7 +9,7 @@ import {
setCanCreateFeedbackPermission,
requestSastContainerReports,
requestDastDiff,
requestDependencyScanningReports,
requestDependencyScanningDiff,
openModal,
setModalData,
requestDismissVulnerability,
......@@ -264,15 +264,15 @@ describe('security reports actions', () => {
});
});
describe('requestDependencyScanningReports', () => {
describe('requestDependencyScanningDiff', () => {
it('should commit request mutation', done => {
testAction(
requestDependencyScanningReports,
requestDependencyScanningDiff,
null,
mockedState,
[
{
type: types.REQUEST_DEPENDENCY_SCANNING_REPORTS,
type: types.REQUEST_DEPENDENCY_SCANNING_DIFF,
},
],
[],
......@@ -1327,7 +1327,7 @@ describe('security reports actions', () => {
[],
[
{
type: 'requestDependencyScanningReports',
type: 'requestDependencyScanningDiff',
},
{
type: 'receiveDependencyScanningDiffSuccess',
......@@ -1360,7 +1360,7 @@ describe('security reports actions', () => {
[],
[
{
type: 'requestDependencyScanningReports',
type: 'requestDependencyScanningDiff',
},
{
type: 'receiveDependencyScanningDiffError',
......@@ -1389,7 +1389,7 @@ describe('security reports actions', () => {
[],
[
{
type: 'requestDependencyScanningReports',
type: 'requestDependencyScanningDiff',
},
{
type: 'receiveDependencyScanningDiffError',
......
......@@ -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', () => {
mutations[types.REQUEST_DEPENDENCY_SCANNING_REPORTS](stateCopy);
mutations[types.REQUEST_DEPENDENCY_SCANNING_DIFF](stateCopy);
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