Skip to content
代码片段 群组 项目
未验证 提交 c2ae560d 编辑于 作者: Alexander Turinske's avatar Alexander Turinske 提交者: GitLab
浏览文件

Merge branch '464368-add-test-for-fallback' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -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"
>
......
......@@ -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',
);
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册