mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Impl test by toBeInTheDocument()
This commit is contained in:
Generated
+1
@@ -29,6 +29,7 @@
|
||||
"@storybook/react": "^8.0.4",
|
||||
"@storybook/react-vite": "^8.0.4",
|
||||
"@storybook/test": "^8.0.4",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.2",
|
||||
"@types/plotly.js-dist-min": "^2.3.4",
|
||||
"@types/react": "^18.2.55",
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"@storybook/react": "^8.0.4",
|
||||
"@storybook/react-vite": "^8.0.4",
|
||||
"@storybook/test": "^8.0.4",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.2",
|
||||
"@types/plotly.js-dist-min": "^2.3.4",
|
||||
"@types/react": "^18.2.55",
|
||||
|
||||
@@ -26,7 +26,9 @@ describe("PlotHistory Tests", async () => {
|
||||
for (const study of window.mockStudies) {
|
||||
test(`PlotHistory (studyId: ${study.study_id})`, () => {
|
||||
setup({ study, dataTestId: `plot-history-${study.study_id}` })
|
||||
expect(screen.getByTestId(`plot-history-${study.study_id}`)).toBeTruthy()
|
||||
expect(
|
||||
screen.getByTestId(`plot-history-${study.study_id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,7 +26,9 @@ describe("TrialTable Tests", async () => {
|
||||
for (const study of window.mockStudies) {
|
||||
test(`TrialTable (studyId: ${study.study_id})`, () => {
|
||||
setup({ study, dataTestId: `trial-table-${study.study_id}` })
|
||||
expect(screen.getByTestId(`trial-table-${study.study_id}`)).toBeTruthy()
|
||||
expect(
|
||||
screen.getByTestId(`trial-table-${study.study_id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true,
|
||||
"strictNullChecks": true,
|
||||
"moduleResolution": "Node",
|
||||
"noUnusedLocals": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
"noImplicitAny": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "ES2020",
|
||||
"strict": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx"]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import "@testing-library/jest-dom/vitest"
|
||||
|
||||
declare global {
|
||||
namespace jest {
|
||||
interface Matchers<R> {
|
||||
toBeInTheDocument(): R
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export default defineConfig({
|
||||
plugins: [react()],
|
||||
test: {
|
||||
environment: "jsdom",
|
||||
setupFiles: ["./test/setup_studies.ts"],
|
||||
setupFiles: ["./test/vitest_setup.ts", "./test/setup_studies.ts"],
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ["@sqlite.org/sqlite-wasm"],
|
||||
|
||||
Reference in New Issue
Block a user