From 264045793a945b335b06287e6f53e2d1fbb997b2 Mon Sep 17 00:00:00 2001
From: Artur Fedorov <afedorov@gitlab.com>
Date: Fri, 9 Feb 2024 00:45:34 +0100
Subject: [PATCH] This MR removes direct data manipulation

As part of Vue 3 migration
overriding method behavior and
direct data manipulation
should be avoided
---
 .../policy_editor/scan_result/editor_component_spec.js     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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 ace0767f36459..e64511738eb3f 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);
       });
 
-- 
GitLab