mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Update tslib/react in response to renaming
This commit is contained in:
@@ -28,7 +28,7 @@ const useMockStudies = () => {
|
||||
|
||||
export const useMockStudy = (studyId: number | undefined) => {
|
||||
const mockStudies = useMockStudies()
|
||||
const mockStudy = mockStudies.find((study) => study.study_id === studyId)
|
||||
const mockStudy = mockStudies.find((study) => study.id === studyId)
|
||||
const mockImportance: Optuna.ParamImportance[][] = [
|
||||
[
|
||||
{ name: "dropout_l0", importance: 0.07990265450296263 },
|
||||
|
||||
@@ -24,10 +24,10 @@ describe("PlotHistory Tests", async () => {
|
||||
}
|
||||
|
||||
for (const study of window.mockStudies) {
|
||||
test(`PlotHistory (study name: ${study.study_name})`, () => {
|
||||
setup({ study, dataTestId: `plot-history-${study.study_id}` })
|
||||
test(`PlotHistory (study name: ${study.name})`, () => {
|
||||
setup({ study, dataTestId: `plot-history-${study.id}` })
|
||||
expect(
|
||||
screen.getByTestId(`plot-history-${study.study_id}`)
|
||||
screen.getByTestId(`plot-history-${study.id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ describe("PlotImportance Tests", async () => {
|
||||
}
|
||||
|
||||
for (const study of window.mockStudies) {
|
||||
test(`PlotImportance (study name: ${study.study_name})`, () => {
|
||||
const importance = window.mockImportances[study.study_name] ?? []
|
||||
test(`PlotImportance (study name: ${study.name})`, () => {
|
||||
const importance = window.mockImportances[study.name] ?? []
|
||||
setup({
|
||||
study,
|
||||
importance,
|
||||
dataTestId: `plot-importance-${study.study_id}`,
|
||||
dataTestId: `plot-importance-${study.id}`,
|
||||
})
|
||||
expect(
|
||||
screen.getByTestId(`plot-importance-${study.study_id}`)
|
||||
screen.getByTestId(`plot-importance-${study.id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ describe("PlotIntermediateValues Tests", async () => {
|
||||
}
|
||||
|
||||
for (const study of window.mockStudies) {
|
||||
test(`PlotIntermediateValues (study name: ${study.study_name})`, () => {
|
||||
setup({ study, dataTestId: `plot-intermediatevalues-${study.study_id}` })
|
||||
test(`PlotIntermediateValues (study name: ${study.name})`, () => {
|
||||
setup({ study, dataTestId: `plot-intermediatevalues-${study.id}` })
|
||||
expect(
|
||||
screen.getByTestId(`plot-intermediatevalues-${study.study_id}`)
|
||||
screen.getByTestId(`plot-intermediatevalues-${study.id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ describe("TrialTable Tests", async () => {
|
||||
}
|
||||
|
||||
for (const study of window.mockStudies) {
|
||||
test(`TrialTable (study name: ${study.study_name})`, () => {
|
||||
setup({ study, dataTestId: `trial-table-${study.study_id}` })
|
||||
test(`TrialTable (study name: ${study.name})`, () => {
|
||||
setup({ study, dataTestId: `trial-table-${study.id}` })
|
||||
expect(
|
||||
screen.getByTestId(`trial-table-${study.study_id}`)
|
||||
screen.getByTestId(`trial-table-${study.id}`)
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user