Răsfoiți Sursa

check create page btn in modal

Mao 4 ani în urmă
părinte
comite
4f951e79e9

+ 6 - 1
packages/app/src/components/PageCreateModal.jsx

@@ -211,7 +211,12 @@ const PageCreateModal = (props) => {
             </div>
 
             <div className="d-flex justify-content-end mt-1 mt-sm-0">
-              <button type="button" className="grw-btn-create-page btn btn-outline-primary rounded-pill text-nowrap ml-3" onClick={createInputPage}>
+              <button
+                type="button"
+                className="grw-btn-create-page btn btn-outline-primary rounded-pill text-nowrap ml-3"
+                onClick={createInputPage}
+                data-testid="createPageBtn"
+              >
                 <i className="icon-fw icon-doc"></i>{t('Create')}
               </button>
             </div>

+ 3 - 2
packages/app/test/cypress/integration/2-basic-features/create-page.spec.ts

@@ -24,8 +24,9 @@ context('Create page modal', () => {
   it("Page create modal is shown successfully", () => {
     cy.getByTestid('newPageBtn').click();
     // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1000);
-    cy.screenshot(`${ssPrefix}-open-page-create-modal`)
+    cy.screenshot(`${ssPrefix}-open-page-create-modal`,{ capture: 'viewport' });
+    cy.getByTestid('createPageBtn').click();
+    cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
   });
 
 });