Skip to content

Commit

Permalink
test: fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
keita-determined committed Aug 1, 2024
1 parent c227fb6 commit 89ad92e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
8 changes: 7 additions & 1 deletion webui/react/src/components/ColumnPickerMenu.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.base {
width: 300px;
width: 380px;

.columns {
display: flex;
Expand All @@ -18,3 +18,9 @@
white-space: nowrap;
}
}

@media only screen and (width <= 390px) {
.base {
width: 320px;
}
}
6 changes: 6 additions & 0 deletions webui/react/src/components/ColumnPickerMenu.test.mock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,12 @@ export const projectColumns: ProjectColumn[] = [
location: 'LOCATION_TYPE_HYPERPARAMETERS',
type: 'COLUMN_TYPE_NUMBER',
},
{
column: 'metadata.hello',
displayName: '',
location: 'LOCATION_TYPE_RUN_METADATA',
type: 'COLUMN_TYPE_TEXT',
},
];

export const initialVisibleColumns = [
Expand Down
5 changes: 4 additions & 1 deletion webui/react/src/components/ColumnPickerMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const locations = [
V1LocationType.EXPERIMENT,
[V1LocationType.VALIDATIONS, V1LocationType.TRAINING, V1LocationType.CUSTOMMETRIC],
V1LocationType.HYPERPARAMETERS,
V1LocationType.RUNMETADATA,
];

const PINNED_COLUMNS_COUNT = 0;
Expand Down Expand Up @@ -95,7 +96,9 @@ describe('ColumnPickerMenu', () => {
const displayName = column.displayName?.length ? column.displayName : column.column;
expect(await screen.findByText(displayName)).toBeInTheDocument();
};
for (const tab of Array.from(tabs)) {

const availableTabs = Array.from(tabs).filter((tab) => tab !== 'Unspecified');
for (const tab of availableTabs) {
await testTab(tab);
}
});
Expand Down
4 changes: 1 addition & 3 deletions webui/react/src/pages/FlatRuns/FlatRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ const FlatRuns: React.FC<Props> = ({ projectId, workspaceId, searchId }) => {
dataPath = `experiment.${currentColumn.column}`;
break;
case V1LocationType.RUN:
case V1LocationType.RUNMETADATA:
dataPath = currentColumn.column;
break;
case V1LocationType.HYPERPARAMETERS:
Expand All @@ -364,9 +365,6 @@ const FlatRuns: React.FC<Props> = ({ projectId, workspaceId, searchId }) => {
case V1LocationType.CUSTOMMETRIC:
dataPath = `summaryMetrics.${currentColumn.column}`;
break;
case V1LocationType.RUNMETADATA:
dataPath = currentColumn.column;
break;
case V1LocationType.UNSPECIFIED:
default:
break;
Expand Down

0 comments on commit 89ad92e

Please sign in to comment.