Skip to content
Snippets Groups Projects

Improve pipeline security tab filter logic

Merged Daniel Tian requested to merge 210327-fix-followup-issues into master
All threads resolved!
Files
2
import testAction from 'helpers/vuex_action_helper';
import createState from 'ee/security_dashboard/store/modules/filters/state';
import * as types from 'ee/security_dashboard/store/modules/filters/mutation_types';
import * as actions from 'ee/security_dashboard/store/modules/filters/actions';
import { DISMISSAL_STATES } from 'ee/security_dashboard/store/modules/filters/constants';
@@ -15,14 +14,21 @@ describe('filters actions', () => {
});
describe('setFilter', () => {
it('should commit the SET_FILTER mutation', () => {
const state = createState();
const payload = { reportType: ['SAST'] };
it('should commit the SET_FILTER mutation with the right casing', () => {
const payload = {
oneWord: ['ABC', 'DEF'],
twoWords: ['123', '456'],
threeTotalWords: ['Abc123', 'dEF456'],
};
return testAction(actions.setFilter, payload, state, [
return testAction(actions.setFilter, payload, undefined, [
{
type: types.SET_FILTER,
payload: { report_type: ['sast'] },
payload: {
one_word: ['abc', 'def'],
two_words: ['123', '456'],
three_total_words: ['abc123', 'def456'],
},
},
]);
});
@@ -36,9 +42,7 @@ describe('filters actions', () => {
`(
'should commit the SET_HIDE_DISMISSED mutation with "$expected" when called with $isHidden',
({ isHidden, expected }) => {
const state = createState();
return testAction(actions.setHideDismissed, isHidden, state, [
return testAction(actions.setHideDismissed, isHidden, undefined, [
{
type: types.SET_HIDE_DISMISSED,
payload: expected,
Loading