From c5ed524a87ba5a93b5c455e56af06a342c98a7ff Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Tue, 30 Apr 2024 11:25:27 +0200
Subject: [PATCH] get by role + busy

---
 src/components/Loader/Loader.spec.tsx                       | 2 +-
 .../Quiz/QuizQuestion/QuizQuestionContentCustom.spec.tsx    | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/components/Loader/Loader.spec.tsx b/src/components/Loader/Loader.spec.tsx
index 7de46f26c..eb7760bfc 100644
--- a/src/components/Loader/Loader.spec.tsx
+++ b/src/components/Loader/Loader.spec.tsx
@@ -7,7 +7,7 @@ describe('Loader component', () => {
   it('should render base Loader', () => {
     const { container } = render(<Loader />)
     expect(container).toMatchSnapshot()
-    expect(screen.getByRole('progressbar')).toBeInTheDocument()
+    expect(screen.getByRole('progressbar', { busy: true })).toBeInTheDocument()
   })
 
   it('should render Electricity Loader', () => {
diff --git a/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.spec.tsx b/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.spec.tsx
index 5a3c5f3dc..9dbdbb019 100644
--- a/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.spec.tsx
+++ b/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.spec.tsx
@@ -50,7 +50,7 @@ describe('QuizCustomQuestionContent component', () => {
     expect(screen.getAllByRole('radio').length).toBe(3)
   })
   it('should be rendered correctly with loader', () => {
-    const { container } = render(
+    render(
       <Provider store={store}>
         <QuizQuestionContentCustom
           userChallenge={userChallengeData[0]}
@@ -60,9 +60,7 @@ describe('QuizCustomQuestionContent component', () => {
         />
       </Provider>
     )
-    expect(
-      container.getElementsByClassName('question-loading')[0]
-    ).toBeInTheDocument()
+    expect(screen.getByRole('progressbar', { busy: true })).toBeInTheDocument()
   })
   it('should display QuizExplanationModal when click on Button', async () => {
     render(
-- 
GitLab