21386: not found test passes Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox...
authorLisa Knox <lisaknox83@gmail.com>
Fri, 23 Feb 2024 15:17:17 +0000 (10:17 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Fri, 23 Feb 2024 15:17:17 +0000 (10:17 -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
services/workbench2/src/components/default-view/default-view.tsx

index 6eab27c827dc3b1d0ffbc6b4cd22ce0f79e9b6fb..9c47a86ae73dd517487f03b404414469c779afc5 100644 (file)
@@ -34,8 +34,6 @@ describe('Page not found tests', function() {
         [
             '/projects/zzzzz-j7d0g-nonexistingproj',
             '/projects/zzzzz-tpzed-nonexistinguser',
-            '/processes/zzzzz-xvhdp-nonexistingproc',
-            '/collections/zzzzz-4zz18-nonexistingcoll'
         ].forEach(function(path) {
             // Using de slower loginAs() method to avoid bumping into dialog
             // dismissal issues that are not related to this test.
@@ -45,6 +43,17 @@ describe('Page not found tests', function() {
             cy.goToPath(path);
 
             // then
+            cy.get('[data-cy=default-view]').should('exist');
+        });
+
+        [
+            '/processes/zzzzz-xvhdp-nonexistingproc',
+            '/collections/zzzzz-4zz18-nonexistingcoll'
+        ].forEach(function(path) {
+            cy.loginAs(adminUser);
+
+            cy.goToPath(path);
+
             cy.get('[data-cy=not-found-view]').should('exist');
         });
     });
index caf0bef75252f04c9291f9f45dead39c3daa03cf..b245c19ba96d27290eacb1f5d11065d97b9522d4 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 data-cy="data-table-default-view" {...classes} {...{ icon, messages }} />;
+        return <DefaultView {...classes} {...{ icon, messages }} />;
     });
index f58bbce1e31957ec1daa6fc95d62790670ac0fcb..5029e39cfd0448380e647be3e71eb5ab21f048af 100644 (file)
@@ -333,7 +333,7 @@ export const DataTable = withStyles(styles)(
                     />
                 );
             } else {
-                //if (isLoaded && !working && !isNotFound)
+                // isLoaded && !working && !isNotFound
                 return (
                     <DataTableDefaultView
                         icon={this.props.defaultViewIcon}
index 5acea6193be906ddb9ec3c865f1d9e80ea068b2f..588dcfa5cce9c7f589a97772ac5c9425d08c4656 100644 (file)
@@ -41,6 +41,7 @@ export const DefaultView = withStyles(styles)(
             {Icon && <Icon className={classnames([classes.icon, classIcon])} />}
             {messages.map((msg: string, index: number) => {
                 return <Typography key={index}
+                    data-cy='default-view'
                     className={classnames([classes.message, classMessage])}>{msg}</Typography>;
             })}
         </Typography>