Commit bf935cbd authored by Illya Klymov's avatar Illya Klymov

Merge branch 'fix_cluster_image_scanning_added_as_part_of_constant' into 'master'

Fixes by removing cluster_image_scanning as part

See merge request gitlab-org/gitlab!73589
parents 93ecce94 53cd2173
......@@ -75,7 +75,7 @@ export default {
severityLevels: [],
vulnerabilityStates: [],
approvalVulnerabilityStatesKeys: Object.keys(APPROVAL_VULNERABILITY_STATES),
reportTypesKeys: Object.keys(REPORT_TYPES),
reportTypesKeys: Object.keys(this.$options.REPORT_TYPES),
severityLevelsKeys: Object.keys(SEVERITY_LEVELS),
...this.getInitialData(),
};
......@@ -513,6 +513,7 @@ export default {
key="all"
is-check-item
:is-checked="areAllScannersSelected"
data-testid="all-scanners-selected"
@click.native.capture.stop="setAllSelectedScanners"
>
<gl-truncate :text="$options.APPROVAL_DIALOG_I18N.form.selectAllLabel" />
......
......@@ -643,6 +643,26 @@ describe('EE Approvals RuleForm', () => {
});
});
describe('and with all scanners selected', () => {
const findAllScannersSelected = () => wrapper.findByTestId('all-scanners-selected');
beforeEach(() => {
createComponent({
initRule: TEST_RULE_VULNERABILITY_CHECK,
});
findAllScannersSelected().trigger('click');
findForm().trigger('submit');
});
it(`dispatches the action on submit without including ${EXCLUDED_REPORT_TYPE}`, () => {
const reportTypesKeys = Object.keys(REPORT_TYPES);
const expectedScanners = reportTypesKeys.filter((item) => item !== EXCLUDED_REPORT_TYPE);
expect(actions.postRule).toHaveBeenCalledWith(
expect.anything(),
expect.objectContaining({ scanners: expectedScanners }),
);
});
});
describe('with invalid number of vulnerabilities', () => {
beforeEach(() => {
createComponent({
......
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