21386: fixed not found test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii...
authorLisa Knox <lisaknox83@gmail.com>
Thu, 22 Feb 2024 16:39:18 +0000 (11:39 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Thu, 22 Feb 2024 16:39:18 +0000 (11:39 -0500)
services/workbench2/cypress/integration/page-not-found.spec.js
services/workbench2/src/components/data-table-default-view/data-table-default-view.tsx
services/workbench2/src/components/data-table/data-table.tsx

index 6eab27c827dc3b1d0ffbc6b4cd22ce0f79e9b6fb..209dcdfac261160452b8158630478a885809a563 100644 (file)
@@ -45,7 +45,7 @@ describe('Page not found tests', function() {
             cy.goToPath(path);
 
             // then
-            cy.get('[data-cy=not-found-view]').should('exist');
+            cy.get('[data-cy=data-table-default-view]').should('exist');
         });
     });
 })
index b245c19ba96d27290eacb1f5d11065d97b9522d4..caf0bef75252f04c9291f9f45dead39c3daa03cf 100644 (file)
@@ -24,5 +24,5 @@ export const DataTableDefaultView = withStyles(styles)(
         const icon = props.icon || DetailsIcon;
         const filterWarning: string[] = props.filtersApplied ? ['Filters are applied to the data.'] : [];
         const messages = filterWarning.concat(props.messages || ['No items found']);
-        return <DefaultView {...classes} {...{ icon, messages }} />;
+        return <DefaultView data-cy="data-table-default-view" {...classes} {...{ icon, messages }} />;
     });
index c1b5167b467574cf4bbd2212b82f8a3414c165f1..f58bbce1e31957ec1daa6fc95d62790670ac0fcb 100644 (file)
@@ -168,7 +168,10 @@ export const DataTable = withStyles(styles)(
             if (prevProps.currentRoute !== this.props.currentRoute) {
                 this.initializeCheckedList([])
             }
-            if((prevProps.working === true && this.props.working === false || this.props.items.length > 0) && !this.state.isLoaded) {
+            if(prevProps.working === true && this.props.working === false) {
+                this.setState({ isLoaded: true });
+            }
+            if((this.props.items.length > 0) && !this.state.isLoaded) {
                 this.setState({ isLoaded: true });
             }
         }
@@ -295,7 +298,6 @@ export const DataTable = withStyles(styles)(
             const { isLoaded } = this.state;
             if (columns[0].name === this.checkBoxColumn.name) columns.shift();
             columns.unshift(this.checkBoxColumn);
-            console.log(items)
             return (
                 <div className={classes.root}>
                     <div className={classes.content}>
@@ -315,7 +317,6 @@ export const DataTable = withStyles(styles)(
             const { isLoaded } = this.state;
             const { working, isNotFound } = this.props;
             const dirty = columns.some(column => getTreeDirty("")(column.filters));
-            console.log('isNotFound', isNotFound, 'isLoaded', isLoaded, 'working', working, )
             if (isNotFound && isLoaded) {
                 return (
                     <DataTableDefaultView 
@@ -410,7 +411,6 @@ export const DataTable = withStyles(styles)(
         );
 
         renderBodyRow = (item: any, index: number) => {
-            console.log('item', item)
             const { onRowClick, onRowDoubleClick, extractKey, classes, currentItemUuid, currentRoute } = this.props;
             return (
                 <TableRow