From 8e63b61b380f2dc4ca24190dd0d7e730bee4cfb6 Mon Sep 17 00:00:00 2001
From: Thomas Hutterer <thutterer@gitlab.com>
Date: Mon, 30 Dec 2024 15:00:20 +0100
Subject: [PATCH] Emit event instead of calling Vue instance method

---
 spec/frontend/todos/components/todos_app_spec.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/spec/frontend/todos/components/todos_app_spec.js b/spec/frontend/todos/components/todos_app_spec.js
index 1c1dedf821fd1..5e1e827eb10e0 100644
--- a/spec/frontend/todos/components/todos_app_spec.js
+++ b/spec/frontend/todos/components/todos_app_spec.js
@@ -42,6 +42,7 @@ describe('TodosApp', () => {
   };
 
   const findTodoItems = () => wrapper.findAllComponents(TodoItem);
+  const findFirstTodoItem = () => wrapper.findComponent(TodoItem);
   const findGlTabs = () => wrapper.findComponent(GlTabs);
   const findFilterBar = () => wrapper.findComponent(TodosFilterBar);
   const findMarkAllDoneButton = () => wrapper.findComponent(TodosMarkAllDoneButton);
@@ -188,7 +189,7 @@ describe('TodosApp', () => {
     expect(todosCountsQuerySuccessHandler).toHaveBeenCalledTimes(1);
 
     // Simulate interacting with a todo item then mousing out of the list zone
-    wrapper.vm.handleItemChanged(1, true);
+    findFirstTodoItem().vm.$emit('change');
     const list = findTodoItemListContainer();
     list.trigger('mouseleave');
 
-- 
GitLab