File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ import * as Optuna from "@optuna/types"
2+ import { render , screen } from "@testing-library/react"
3+ import React from "react"
4+ import { describe , expect , test } from "vitest"
5+ import { PlotTimeline } from "../src/components/PlotTimeline"
6+
7+ describe ( "PlotSlice Tests" , async ( ) => {
8+ const setup = ( {
9+ study,
10+ dataTestId,
11+ } : { study : Optuna . Study ; dataTestId : string } ) => {
12+ const Wrapper = ( {
13+ dataTestId,
14+ children,
15+ } : {
16+ dataTestId : string
17+ children : React . ReactNode
18+ } ) => < div data-testid = { dataTestId } > { children } </ div >
19+ return render (
20+ < Wrapper dataTestId = { dataTestId } >
21+ < PlotTimeline study = { study } />
22+ </ Wrapper >
23+ )
24+ }
25+
26+ for ( const study of window . mockStudies ) {
27+ test ( `PlotSlice (study name: ${ study . name } )` , ( ) => {
28+ setup ( { study, dataTestId : `plot-slice-${ study . id } ` } )
29+ expect ( screen . getByTestId ( `plot-slice-${ study . id } ` ) ) . toBeInTheDocument ( )
30+ } )
31+ }
32+ } )
You can’t perform that action at this time.
0 commit comments