import * as React from "react";
import { ThemeProvider } from "styled-components";
import { render, cleanup, screen } from "@testing-library/react";
import "@testing-library/jest-dom";

import { parseTheme } from "@ax/helpers";
import Loading from "@ax/components/Loading";
import globalTheme from "@ax/themes/theme.json";

afterEach(cleanup);

describe("Loading component rendering", () => {
	it("should render the component", () => {
		render(
			<ThemeProvider theme={parseTheme(globalTheme)}>
				<Loading />
			</ThemeProvider>,
		);

		const wrapper = screen.getByTestId("loading-wrapper");
		expect(wrapper).toBeTruthy();
	});
});
