File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { render , waitFor } from "@testing-library/react" ;
2+ import { getByRole , render } from "@testing-library/react" ;
33import DxcBarChart from "./BarChart" ;
44import userEvent from "@testing-library/user-event" ;
55
@@ -90,7 +90,7 @@ describe("Bar Chart component tests", () => {
9090 } ) ;
9191 test ( "onRetry is called when the retry button is clicked" , async ( ) => {
9292 const onRetry = jest . fn ( ) ;
93- const { getByText } = render (
93+ const { getByText, getByRole } = render (
9494 < DxcBarChart
9595 onRetry = { onRetry }
9696 error = "Error"
@@ -115,7 +115,7 @@ describe("Bar Chart component tests", () => {
115115 />
116116 ) ;
117117 expect ( getByText ( "Error" ) ) . toBeTruthy ( ) ;
118- await userEvent . click ( getByText ( "Retry ") ) ;
118+ await userEvent . click ( getByRole ( "button ") ) ;
119119 expect ( onRetry ) . toHaveBeenCalled ( ) ;
120120 } ) ;
121121} ) ;
You can’t perform that action at this time.
0 commit comments