kaori 3 лет назад
Родитель
Сommit
0947554a14

+ 4 - 4
packages/app/src/components/CreateTemplateModal.jsx

@@ -1,10 +1,9 @@
 import React from 'react';
-import PropTypes from 'prop-types';
-
-import { Modal, ModalHeader, ModalBody } from 'reactstrap';
 
-import { withTranslation } from 'react-i18next';
 import { pathUtils } from '@growi/core';
+import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
+import { Modal, ModalHeader, ModalBody } from 'reactstrap';
 import urljoin from 'url-join';
 
 
@@ -30,6 +29,7 @@ const CreateTemplateModal = (props) => {
         </div>
         <div className="card-footer text-center">
           <a
+            data-testid={`template-button-${target}`}
             href={generateUrl(label)}
             className="btn btn-sm btn-primary"
             id={`template-button-${target}`}

+ 18 - 1
packages/app/test/cypress/integration/2-basic-features/open-page-create-edit-template-modal.spec.ts

@@ -33,7 +33,7 @@ context('Open Page presentation Template Modal', () => {
     cy.getByTestid('page-presentation-modal').should('be.visible')
     cy.screenshot(`${ssPrefix}-open-page-presentation-bootstrap4`);
  });
-  it('CreateEditTemplatePage is shown successfully', () => {
+  it('Moving to Template editor Page for only child pages successfully', () => {
      cy.visit('/Sandbox/Bootstrap4', {  });
      cy.get('#grw-subnav-container').within(() => {
        cy.getByTestid('open-page-item-control-btn').click();
@@ -42,6 +42,23 @@ context('Open Page presentation Template Modal', () => {
 
      cy.getByTestid('page-template-modal').should('be.visible')
      cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
+     cy.getByTestid('template-button-children').click();
+     cy.url().should('include', '/_template#edit');
+     cy.screenshot();
   });
 
+  it('Moving to Template editor Page including decendants successfully', () => {
+    cy.visit('/Sandbox/Bootstrap4', {  });
+    cy.get('#grw-subnav-container').within(() => {
+      cy.getByTestid('open-page-item-control-btn').click();
+      cy.getByTestid('open-page-template-modal-btn').click();
+   });
+
+    cy.getByTestid('page-template-modal').should('be.visible')
+    cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
+    cy.getByTestid('template-button-decendants').click();
+    cy.url().should('include', '/__template#edit');
+    cy.screenshot();
+ });
+
 });