From 9af446e2cee0b181861d9a1a1f05f206b4b485ba Mon Sep 17 00:00:00 2001
From: Artur Fedorov <afedorov@gitlab.com>
Date: Sat, 8 Feb 2025 00:25:52 +0100
Subject: [PATCH] Fix Vue 3 failing test

Rearrange attribute order

EE: true
---
 .../vue_shared/components/markdown/suggestion_diff_row.vue  | 2 +-
 scripts/frontend/quarantined_vue3_specs.txt                 | 1 -
 .../components/markdown/suggestion_diff_row_spec.js         | 6 +++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue
index 0b598d3acafba..05647c0793fdb 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue
@@ -32,9 +32,9 @@ export default {
       {{ line.new_line }}
     </td>
     <td
+      data-testid="suggestion-diff-content"
       class="line_content"
       :class="[{ 'd-table-cell': displayAsCell }, lineType]"
-      data-testid="suggestion-diff-content"
     >
       <span v-if="line.rich_text" v-safe-html="line.rich_text" class="line"></span>
       <span v-else-if="line.text" class="line">{{ line.text }}</span>
diff --git a/scripts/frontend/quarantined_vue3_specs.txt b/scripts/frontend/quarantined_vue3_specs.txt
index d66a8cc84fb15..9de7dcb19aeaf 100644
--- a/scripts/frontend/quarantined_vue3_specs.txt
+++ b/scripts/frontend/quarantined_vue3_specs.txt
@@ -276,7 +276,6 @@ spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root
 spec/frontend/vue_shared/components/filtered_search_bar/tokens/date_token_spec.js
 spec/frontend/vue_shared/components/markdown/header_spec.js
 spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js
-spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
 spec/frontend/vue_shared/components/markdown_drawer/markdown_drawer_spec.js
 spec/frontend/vue_shared/components/metric_images/metric_image_details_modal_spec.js
 spec/frontend/vue_shared/components/page_heading_spec.js
diff --git a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
index c46a2d3e11785..fea8aa65001ff 100644
--- a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
+++ b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
@@ -1,4 +1,4 @@
-import { shallowMount } from '@vue/test-utils';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
 import SuggestionDiffRow from '~/vue_shared/components/markdown/suggestion_diff_row.vue';
 
 const oldLine = {
@@ -27,14 +27,14 @@ describe('SuggestionDiffRow', () => {
   let wrapper;
 
   const factory = (options = {}) => {
-    wrapper = shallowMount(SuggestionDiffRow, {
+    wrapper = shallowMountExtended(SuggestionDiffRow, {
       ...options,
     });
   };
 
   const findOldLineWrapper = () => wrapper.find('.old_line');
   const findNewLineWrapper = () => wrapper.find('.new_line');
-  const findSuggestionContent = () => wrapper.find('[data-testid="suggestion-diff-content"]');
+  const findSuggestionContent = () => wrapper.findByTestId('suggestion-diff-content');
 
   describe('renders correctly', () => {
     it('renders the correct base suggestion markup', () => {
-- 
GitLab