From 07b31a2bccd2a7152a94e944782ab7a75e41444e Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Sat, 7 Dec 2024 09:53:52 -0800 Subject: [PATCH 1/3] Fixed Base Email template path + new test for user create --- .../e2e/ui/admin/admin.user.password.spec.js | 16 --------- cypress/e2e/ui/admin/admin.user.spec.js | 33 +++++++++++++++++++ src/ChurchCRM/Emails/BaseEmail.php | 2 +- 3 files changed, 34 insertions(+), 17 deletions(-) delete mode 100644 cypress/e2e/ui/admin/admin.user.password.spec.js create mode 100644 cypress/e2e/ui/admin/admin.user.spec.js diff --git a/cypress/e2e/ui/admin/admin.user.password.spec.js b/cypress/e2e/ui/admin/admin.user.password.spec.js deleted file mode 100644 index 1a74dedae3..0000000000 --- a/cypress/e2e/ui/admin/admin.user.password.spec.js +++ /dev/null @@ -1,16 +0,0 @@ -context("Admin User Password", () => { - it("List System Users", () => { - cy.loginAdmin("UserList.php"); - cy.contains("Church Admin"); - }); - - it("Admin Change password", () => { - cy.loginAdmin("v2/user/95/changePassword"); - cy.contains("Change Password: Judith Kennedy"); - cy.get("#NewPassword1").type("new-user-password"); - cy.get("#NewPassword2").type("new-user-password"); - cy.get("form:nth-child(2)").submit(); - cy.url().should("contains", "v2/user/95/changePassword"); - cy.contains("Password Change Successful"); - }); -}); diff --git a/cypress/e2e/ui/admin/admin.user.spec.js b/cypress/e2e/ui/admin/admin.user.spec.js new file mode 100644 index 0000000000..c3053520f1 --- /dev/null +++ b/cypress/e2e/ui/admin/admin.user.spec.js @@ -0,0 +1,33 @@ +context("Admin User Password", () => { + it("List System Users", () => { + cy.loginAdmin("UserList.php"); + cy.contains("Church Admin"); + }); + + it("Admin Change password", () => { + cy.loginAdmin("v2/user/95/changePassword"); + cy.contains("Change Password: Judith Kennedy"); + cy.get("#NewPassword1").type("new-user-password"); + cy.get("#NewPassword2").type("new-user-password"); + cy.get("form:nth-child(2)").submit(); + cy.url().should("contains", "v2/user/95/changePassword"); + cy.contains("Password Change Successful"); + }); + + + it("Create System Users", () => { + cy.loginAdmin("UserList.php"); + cy.contains("Peyton Ray").should('not.exist'); + cy.visit("PersonView.php?PersonID=25"); + cy.contains("Peyton Ray"); + cy.contains("Edit User").should('not.exist'); + cy.contains("Make User"); + cy.visit('UserEditor.php?NewPersonID=25'); + cy.contains("User Editor"); + cy.get('.TextColumnWithBottomBorder > select').type('skin-yellow'); + cy.get('tr:nth-child(14) .btn-primary').click(); + cy.url().should('contains', 'UserList.php'); + cy.contains("Peyton Ray"); + + }); +}); diff --git a/src/ChurchCRM/Emails/BaseEmail.php b/src/ChurchCRM/Emails/BaseEmail.php index c5ee0aa7e5..2fca5d2fd9 100644 --- a/src/ChurchCRM/Emails/BaseEmail.php +++ b/src/ChurchCRM/Emails/BaseEmail.php @@ -26,7 +26,7 @@ public function __construct(array $toAddresses) $this->mail->addAddress($email); } - $loader = new FilesystemLoader('../templates/email'); + $loader = new FilesystemLoader('templates/email'); $this->twig = new Environment($loader); } From 22b74ef5ac61c5e3fac4233922b0f1633cdd6594 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Sat, 7 Dec 2024 10:42:09 -0800 Subject: [PATCH 2/3] makes sure the path works for API and PHP code --- src/ChurchCRM/Emails/BaseEmail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChurchCRM/Emails/BaseEmail.php b/src/ChurchCRM/Emails/BaseEmail.php index 2fca5d2fd9..a1935fcc2f 100644 --- a/src/ChurchCRM/Emails/BaseEmail.php +++ b/src/ChurchCRM/Emails/BaseEmail.php @@ -26,7 +26,7 @@ public function __construct(array $toAddresses) $this->mail->addAddress($email); } - $loader = new FilesystemLoader('templates/email'); + $loader = new FilesystemLoader(dirname(__FILE__) . '/../../templates/email'); $this->twig = new Environment($loader); } From 3395d1dccbf3a5c9d3e77d2603831974818fa560 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Wed, 1 Jan 2025 15:35:31 -0800 Subject: [PATCH 3/3] Update src/ChurchCRM/Emails/BaseEmail.php Co-authored-by: Arun Philip --- src/ChurchCRM/Emails/BaseEmail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChurchCRM/Emails/BaseEmail.php b/src/ChurchCRM/Emails/BaseEmail.php index a1935fcc2f..6da5f6621f 100644 --- a/src/ChurchCRM/Emails/BaseEmail.php +++ b/src/ChurchCRM/Emails/BaseEmail.php @@ -26,7 +26,7 @@ public function __construct(array $toAddresses) $this->mail->addAddress($email); } - $loader = new FilesystemLoader(dirname(__FILE__) . '/../../templates/email'); + $loader = new FilesystemLoader(__DIR__ . '/../../templates/email'); $this->twig = new Environment($loader); }