From cb546a215788eab28f15048cac77c7e3230cf41f Mon Sep 17 00:00:00 2001 From: keisuke-umezawa Date: Fri, 20 Sep 2024 14:20:12 +0900 Subject: [PATCH] Add PlotTimeline.test.tsx --- tslib/react/test/PlotTimeline.test.tsx | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tslib/react/test/PlotTimeline.test.tsx diff --git a/tslib/react/test/PlotTimeline.test.tsx b/tslib/react/test/PlotTimeline.test.tsx new file mode 100644 index 00000000..16f41c14 --- /dev/null +++ b/tslib/react/test/PlotTimeline.test.tsx @@ -0,0 +1,32 @@ +import * as Optuna from "@optuna/types" +import { render, screen } from "@testing-library/react" +import React from "react" +import { describe, expect, test } from "vitest" +import { PlotTimeline } from "../src/components/PlotTimeline" + +describe("PlotSlice Tests", async () => { + const setup = ({ + study, + dataTestId, + }: { study: Optuna.Study; dataTestId: string }) => { + const Wrapper = ({ + dataTestId, + children, + }: { + dataTestId: string + children: React.ReactNode + }) =>
{children}
+ return render( + + + + ) + } + + for (const study of window.mockStudies) { + test(`PlotSlice (study name: ${study.name})`, () => { + setup({ study, dataTestId: `plot-slice-${study.id}` }) + expect(screen.getByTestId(`plot-slice-${study.id}`)).toBeInTheDocument() + }) + } +})