diff --git a/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/details_drawer.vue b/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/details_drawer.vue index 4905458d95c7574fdf7ec19d3cd9acd7c300d85d..0caf9c02c4314d738c4737791be1385e2997a017 100644 --- a/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/details_drawer.vue +++ b/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/details_drawer.vue @@ -141,7 +141,7 @@ export default { <template #additional-details> <info-row - v-if="fallbackBehaviorText" + v-show="fallbackBehaviorText" :label="$options.i18n.fallbackTitle" data-testid="additional-details" > diff --git a/ee/spec/frontend/security_orchestration/components/policy_drawer/scan_result/details_drawer_spec.js b/ee/spec/frontend/security_orchestration/components/policy_drawer/scan_result/details_drawer_spec.js index 442ff4c1b1d74815ebf5b0bea8ca876ca310b9fd..fb86d4dc1d35da36d5a61f9a36296ad674115d9e 100644 --- a/ee/spec/frontend/security_orchestration/components/policy_drawer/scan_result/details_drawer_spec.js +++ b/ee/spec/frontend/security_orchestration/components/policy_drawer/scan_result/details_drawer_spec.js @@ -142,17 +142,16 @@ describe('DetailsDrawer component', () => { it('does not render the fallback behavior section if the policy does not have the fallback behavior property', () => { factory({ props: { - policy: { - ...mockProjectScanResultPolicy, - yaml: mockNoFallbackScanResultManifest, - }, + policy: { ...mockProjectScanResultPolicy, yaml: mockNoFallbackScanResultManifest }, }, }); - expect(findAdditionalDetails().exists()).toBe(false); + expect(findAdditionalDetails().isVisible()).toBe(false); + expect(findAdditionalDetails().text()).toBe(''); }); it('renders the open fallback behavior', () => { factory(); + expect(findAdditionalDetails().isVisible()).toBe(true); expect(findAdditionalDetails().text()).toBe( 'Fail open: Allow the merge request to proceed, even if not all criteria are met', ); @@ -167,6 +166,7 @@ describe('DetailsDrawer component', () => { }, }, }); + expect(findAdditionalDetails().isVisible()).toBe(true); expect(findAdditionalDetails().text()).toBe( 'Fail closed: Block the merge request until all criteria are met', );