// License: LGPL-3.0-or-later import * as React from "react"; import { render, waitFor } from "@testing-library/react"; import '@testing-library/jest-dom/extend-expect'; import AnimatedCheckmark from "./AnimatedCheckmark"; import { IntlProvider } from "../../intl"; import I18n from '../../../i18n'; function Wrapper(props:React.PropsWithChildren) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const translations = I18n.translations['en'] as any; return ( {props.children} ); } describe('Animated Checkmark', () => { it('check if it renders', async () => { expect.hasAssertions(); const {getByTestId} = render(); const checkmark = getByTestId("CheckmarkTest"); await waitFor(() => { expect(checkmark).toBeInTheDocument(); }); }); it('check Aria Label Message', async () => { expect.hasAssertions(); const {queryByLabelText } = render(); await waitFor(() => { expect(queryByLabelText("You have successfully signed in.")).toBeInTheDocument(); }); }); it('role has status as value', async () => { expect.hasAssertions(); const {getByTestId } = render(); const role = getByTestId("CheckmarkTest"); await waitFor(() => { expect(role).toHaveAttribute('role', 'status'); }); }); });