diff --git a/ee/spec/frontend/security_orchestration/components/policy_editor/scan_result/editor_component_spec.js b/ee/spec/frontend/security_orchestration/components/policy_editor/scan_result/editor_component_spec.js index ace0767f364595ba6aa3c9dffbfb364972e241c5..e64511738eb3f65242e2a044e63011b7fa6604e4 100644 --- a/ee/spec/frontend/security_orchestration/components/policy_editor/scan_result/editor_component_spec.js +++ b/ee/spec/frontend/security_orchestration/components/policy_editor/scan_result/editor_component_spec.js @@ -275,7 +275,7 @@ describe('EditorComponent', () => { expect(findAddRuleButton().exists()).toBe(false); }); - it('updates an existing rule', () => { + it('updates an existing rule', async () => { const newValue = { type: 'scan_finding', branches: [], @@ -286,9 +286,8 @@ describe('EditorComponent', () => { }; factory(); - findAllRuleSections().at(0).vm.$emit('changed', newValue); - - expect(wrapper.vm.policy.rules[0]).toEqual(newValue); + await findAllRuleSections().at(0).vm.$emit('changed', newValue); + expect(findAllRuleSections().at(0).props('initRule')).toEqual(newValue); expect(findPolicyEditorLayout().props('policy').rules[0].vulnerabilities_allowed).toBe(1); });