diff --git a/__tests__/components/Forms/SigninButton.test.tsx b/__tests__/components/Forms/SigninButton.test.tsx index 493fb1c..6530330 100644 --- a/__tests__/components/Forms/SigninButton.test.tsx +++ b/__tests__/components/Forms/SigninButton.test.tsx @@ -27,7 +27,7 @@ describe("render the button", () => { Facebook ); - const image = screen.getByRole("img"); + const image = screen.getByLabelText("third-part-service-login"); expect(image).toBeInTheDocument(); }); diff --git a/__tests__/components/Inputs/BBInput.test.tsx b/__tests__/components/Inputs/BBInput.test.tsx index 4c8d0b8..727c10f 100644 --- a/__tests__/components/Inputs/BBInput.test.tsx +++ b/__tests__/components/Inputs/BBInput.test.tsx @@ -5,7 +5,7 @@ import { render, screen } from "@testing-library/react"; describe("Black Burger input with image", () => { test("render image", () => { render(); - const image = screen.getByRole("img"); + const image = screen.getByLabelText("input icon"); expect(image).toBeInTheDocument(); }); diff --git a/__tests__/components/Inputs/InputPassword.test.tsx b/__tests__/components/Inputs/InputPassword.test.tsx index 42b0c5e..53e547f 100644 --- a/__tests__/components/Inputs/InputPassword.test.tsx +++ b/__tests__/components/Inputs/InputPassword.test.tsx @@ -5,7 +5,7 @@ import { fireEvent, render, screen } from "@testing-library/react"; describe("Render input password", () => { test("render image", () => { render(); - const image = screen.getByRole("img", { name: "icon" }); + const image = screen.getByAltText("senha"); expect(image).toBeInTheDocument(); }); diff --git a/__tests__/components/Navigation/ArrowBackToHome.test.tsx b/__tests__/components/Navigation/ArrowBackToHome.test.tsx index e0d036b..53285d8 100644 --- a/__tests__/components/Navigation/ArrowBackToHome.test.tsx +++ b/__tests__/components/Navigation/ArrowBackToHome.test.tsx @@ -9,20 +9,20 @@ const pushMock = jest.fn(); describe("User navigation to home page", () => { test("render image", () => { render(); - const image = screen.getByRole("img"); + const image = screen.getByAltText("voltar"); expect(image).toBeInTheDocument(); }); test("should have cursor pointer", () => { render(); - const image = screen.getByRole("img"); + const image = screen.getByAltText("voltar"); expect(image).toHaveClass("cursor-pointer"); }); test("navigation after click", () => { (useRouter as jest.Mock).mockReturnValue({ push: pushMock }); render(); - fireEvent.click(screen.getByRole("img")); + fireEvent.click(screen.getByAltText("voltar")); expect(pushMock).toHaveBeenCalledWith("/home"); }); }); diff --git a/__tests__/components/Navigation/UserButtonNavigation.test.tsx b/__tests__/components/Navigation/UserButtonNavigation.test.tsx index 75a8d83..501f938 100644 --- a/__tests__/components/Navigation/UserButtonNavigation.test.tsx +++ b/__tests__/components/Navigation/UserButtonNavigation.test.tsx @@ -24,7 +24,7 @@ describe("User Button Navigation UI", () => { test("render menu icon", () => { render(); - const icon = screen.getByRole("img"); + const icon = screen.getByAltText("user"); expect(icon).toBeInTheDocument(); }); }); diff --git a/__tests__/components/Surfaces/FeatureCard.test.tsx b/__tests__/components/Surfaces/FeatureCard.test.tsx index 78f50ce..8e16071 100644 --- a/__tests__/components/Surfaces/FeatureCard.test.tsx +++ b/__tests__/components/Surfaces/FeatureCard.test.tsx @@ -27,7 +27,7 @@ describe("Featured card", () => { productPrice="1000" /> ); - const img = screen.getByRole("img"); + const img = screen.getByLabelText("product-image"); expect(img).toBeInTheDocument(); expect(img).toHaveAttribute("alt", "alt test"); expect(img).toHaveAttribute("src", "/test.svg"); diff --git a/src/components/Forms/SignInForm/SignInButton.tsx b/src/components/Forms/SignInForm/SignInButton.tsx index 9c2f097..5b707f4 100644 --- a/src/components/Forms/SignInForm/SignInButton.tsx +++ b/src/components/Forms/SignInForm/SignInButton.tsx @@ -1,7 +1,6 @@ "use client"; import { signInresult } from "@/services/auth/signin"; -import { signIn } from "next-auth/react"; import Image from "next/image"; import { useRouter } from "next/navigation"; @@ -55,6 +54,7 @@ export default function SignInButton({ height={0} sizes="100vw" className="w-6 h-6" + aria-label="third-part-service-login" />