2022-11-15 13:53:39 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { render, screen } from "@testing-library/react";
|
2025-09-29 17:10:41 +00:00
|
|
|
import BackButton from "./BackButton";
|
2022-11-15 13:53:39 +00:00
|
|
|
|
2025-09-29 17:10:41 +00:00
|
|
|
describe("BackButton - component", () => {
|
2022-11-15 13:53:39 +00:00
|
|
|
it("renders text and icon", () => {
|
2025-09-29 17:10:41 +00:00
|
|
|
render(<BackButton text="Back to software" />);
|
2022-11-15 13:53:39 +00:00
|
|
|
|
|
|
|
|
const text = screen.getByText("Back to software");
|
2023-10-31 16:06:38 +00:00
|
|
|
const icon = screen.getByTestId("chevron-left-icon");
|
2022-11-15 13:53:39 +00:00
|
|
|
|
|
|
|
|
expect(text).toBeInTheDocument();
|
|
|
|
|
expect(icon).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
});
|