import React from "react"; import { render, screen } from "@testing-library/react"; import { expect, test } from "vitest"; // Component import ToolbarLayout from "./ToolbarLayout"; test("should display the ToolbarLayout with required props", () => { const { container } = render( Test Toolbar Element, }, ]} /> ); expect(screen.getByText("Test Toolbar Element")).toBeInTheDocument(); expect(container.querySelector('[id="1"]')).toBeInTheDocument(); }); test("should display the ToolbarLayout with the proper amount of children", () => { render( Test Toolbar Item, }, { key: 2, element:
Test Toolbar Item
, }, { key: 3, element:
Test Toolbar Item
, }, ]} /> ); expect(screen.getAllByText(/Test Toolbar Item/)).toHaveLength(3); });