/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { render } from "@testing-library/react";
import { DetailLink } from "./DetailLink";
import { ErrorToastContentForJob } from "./ErrorToastContentForJob";
import userEvent from "@testing-library/user-event";
import { FormatResourceWithClusterInfo, FormatResourcesWithClusterInfo } from "./FormatResourceWithClusterInfo";
describe(" spec", () => {
it("render with default props", async () => {
const { container } = render();
expect(container).toMatchSnapshot();
});
it("render with writing index", async () => {
const { container } = render();
expect(container).toMatchSnapshot();
});
it("render with cluster info", async () => {
const { container } = render(
);
expect(container).toMatchSnapshot();
});
});
describe(" spec", () => {
it("render with default props", async () => {
const { container } = render();
expect(container).toMatchSnapshot();
});
it("render with action", async () => {
const { container, getByText, findByText } = render();
expect(container).toMatchSnapshot();
await userEvent.click(getByText("See full error"));
await findByText("fullError");
});
});
describe(" spec", () => {
it("render with default props", async () => {
const { container } = render();
expect(container).toMatchSnapshot();
});
it("render with cluster info", async () => {
const { container } = render(
);
expect(container).toMatchSnapshot();
});
});
describe(" spec", () => {
it("render with default props", async () => {
const { container } = render();
expect(container).toMatchSnapshot();
});
it("render with cluster info", async () => {
const { container } = render(
);
expect(container).toMatchSnapshot();
});
});