import React from 'react';
import "@testing-library/jest-dom";
import { TitleText } from "../src/components"
import { render, screen } from "@testing-library/react";


describe("Test TitleText component", () => {
    it("should render  TitleText" , () => {
        const mockText = "My Title"
            
        render(<TitleText>{mockText}</TitleText>)
        const text = screen.getByTestId("title")
        // screen.debug(text)
        expect(text).toHaveTextContent(mockText)
     })
    it("should render TitleText with  empty child" , () => {
        const mockText = ""
            
        render(<TitleText></TitleText>)
        const text = screen.getByTestId("title")
        // screen.debug(text)
        expect(text).toHaveTextContent("")
     })
})

