Răsfoiți Sursa

Create a new test id (grw-contextual-sub-nav)

Shun Miyazawa 3 ani în urmă
părinte
comite
e5e13d6f5e

+ 15 - 13
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -360,19 +360,21 @@ const GrowiContextualSubNavigation = (props) => {
   };
 
   return (
-    <GrowiSubNavigation
-      page={currentPage}
-      showDrawerToggler={isDrawerMode}
-      showTagLabel={isAbleToShowTagLabel}
-      showPageAuthors={isAbleToShowPageAuthors}
-      isGuestUser={isGuestUser}
-      isDrawerMode={isDrawerMode}
-      isCompactMode={isCompactMode}
-      tags={isViewMode ? tagsInfoData?.tags : tagsForEditors}
-      tagsUpdatedHandler={isViewMode ? tagsUpdatedHandlerForViewMode : tagsUpdatedHandlerForEditMode}
-      controls={ControlComponents}
-      additionalClasses={['container-fluid']}
-    />
+    <div data-testid="grw-contextual-sub-nav">
+      <GrowiSubNavigation
+        page={currentPage}
+        showDrawerToggler={isDrawerMode}
+        showTagLabel={isAbleToShowTagLabel}
+        showPageAuthors={isAbleToShowPageAuthors}
+        isGuestUser={isGuestUser}
+        isDrawerMode={isDrawerMode}
+        isCompactMode={isCompactMode}
+        tags={isViewMode ? tagsInfoData?.tags : tagsForEditors}
+        tagsUpdatedHandler={isViewMode ? tagsUpdatedHandlerForViewMode : tagsUpdatedHandlerForEditMode}
+        controls={ControlComponents}
+        additionalClasses={['container-fluid']}
+      />
+    </div>
   );
 };
 

+ 2 - 2
packages/app/test/cypress/integration/20-basic-features/use-tools.spec.ts

@@ -56,7 +56,7 @@ context('Modal for page operation', () => {
     cy.getByTestid('save-page-btn').click();
     cy.get('body').should('not.have.class', 'on-edit');
 
-    cy.get('.grw-subnav').should('be.visible');
+    cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
     cy.screenshot(`${ssPrefix}create-today-page`);
   });
   it('Successfully create page under specific path', () => {
@@ -73,7 +73,7 @@ context('Modal for page operation', () => {
     cy.getByTestid('btn-submit').click();
     cy.get('body').should('not.have.class', 'on-edit');
 
-    cy.get('.grw-subnav').should('be.visible');
+    cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
     cy.screenshot(`${ssPrefix}create-page-under-path`);
   });