Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9dda79f
Add finance module Slim 4 MVC structure
DawoudIO Dec 2, 2025
4aa0bbe
Add finance module SCSS styles
DawoudIO Dec 2, 2025
ffd5500
Add dashboard methods to FinancialService
DawoudIO Dec 2, 2025
1a2b750
Update menu from Deposit to Finance with Dashboard link
DawoudIO Dec 2, 2025
a83a452
Allow admins to access finance routes via middleware
DawoudIO Dec 2, 2025
1e4e04b
Improve PledgeEditor UX to distinguish Pledge vs Payment mode
DawoudIO Dec 2, 2025
bd0645a
Add reusable system-settings-panel webpack component
DawoudIO Dec 2, 2025
f9c2d99
Add Cypress tests for finance dashboard and reports index
DawoudIO Dec 2, 2025
6ff142a
Add nofinance test user for access control testing
DawoudIO Dec 2, 2025
bf9ab00
Add integration tests for finance dashboard navigation
DawoudIO Dec 2, 2025
b24e2c6
Potential fix for pull request finding 'Unused variable, import, func…
DawoudIO Dec 2, 2025
dceda75
Update webpack/system-settings-panel.js
DawoudIO Dec 2, 2025
133e8ef
Update copilot-instructions.md
DawoudIO Dec 2, 2025
a3c77ff
Merge branch 'feature/finance-dashboard-module' of https://github.com…
DawoudIO Dec 2, 2025
679921c
Update index.php
DawoudIO Dec 2, 2025
207a805
Update messages.po
DawoudIO Dec 2, 2025
d823d5b
Update system-settings-panel.scss
DawoudIO Dec 2, 2025
0f4a629
settingsHtml
DawoudIO Dec 2, 2025
44975d4
fixed test by adding a new user
DawoudIO Dec 2, 2025
83aced1
Merge branch 'master' into feature/finance-dashboard-module
DawoudIO Dec 2, 2025
425ca1a
Fix: delegate MakeFYString to FinancialService::formatFiscalYear and …
DawoudIO Dec 2, 2025
d9473f3
Merge branch 'master' into feature/finance-dashboard-module
DawoudIO Dec 2, 2025
874e8a0
Update private.admin.user.settings.spec.js
DawoudIO Dec 2, 2025
39c5b5b
Merge branch 'master' into feature/finance-dashboard-module
DawoudIO Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions cypress/e2e/ui/finance/finance.dashboard.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
/// <reference types="cypress" />

/**
* Finance Dashboard Tests
*
* Tests for the new /finance/ module with Slim 4 MVC structure.
* The finance dashboard provides:
* - YTD payment and pledge metrics
* - Tax year reporting checklist
* - Quick actions for deposits and reports
* - Recent deposits list
* - Donation funds overview
*/

describe("Finance Dashboard", () => {
beforeEach(() => {
cy.setupAdminSession();
});

it("should load the finance dashboard", () => {
cy.visit("/finance/");
cy.contains("Finance Dashboard");
cy.contains("Fiscal Year");
});

it("should display YTD metrics cards", () => {
cy.visit("/finance/");

// Check for the 4 metric cards
cy.contains("YTD Payments");
cy.contains("YTD Pledges");
cy.contains("Donor Families");
cy.contains("Total Payments");
});

it("should display Quick Actions section", () => {
cy.visit("/finance/");

cy.contains("Quick Actions");
cy.contains("Create Deposit");
cy.contains("Add Payment");
cy.contains("Generate Reports");
});

it("should navigate to deposits page from Create Deposit button", () => {
cy.visit("/finance/");

// Find and click the Create Deposit button
cy.contains("a", "Create Deposit").click();
cy.url().should("contain", "FindDepositSlip.php");
cy.contains("Deposit Listing");
});

it("should navigate to reports page from Generate Reports button", () => {
cy.visit("/finance/");

// Find and click the Generate Reports button
cy.contains("a", "Generate Reports").click();
cy.url().should("contain", "/finance/reports");
cy.contains("Financial Reports");
});

it("should display Tax Year Reporting Checklist", () => {
cy.visit("/finance/");

cy.contains("Tax Year Reporting Checklist");
cy.contains("Close All Deposits");
cy.contains("Review Donation Funds");
cy.contains("Church Information");
cy.contains("Tax Report Verbiage");
cy.contains("Generate Tax Statements");
});

it("should display Recent Deposits section", () => {
cy.visit("/finance/");

cy.contains("Recent Deposits");
cy.contains("View All");

// Check table headers if deposits exist
cy.get("body").then(($body) => {
if ($body.find("table.table-hover").length > 0) {
cy.contains("th", "ID");
cy.contains("th", "Date");
cy.contains("th", "Type");
cy.contains("th", "Status");
}
});
});

it("should display Deposit Statistics sidebar", () => {
cy.visit("/finance/");

cy.contains("Deposit Statistics");
cy.contains("Total Deposits:");
cy.contains("Open Deposits:");
cy.contains("Closed Deposits:");
});

it("should display Donation Funds sidebar", () => {
cy.visit("/finance/");

cy.contains("Donation Funds");
});

it("should link to Donation Fund Editor from Manage Funds button", () => {
cy.visit("/finance/");

// Admin should see Manage Funds link
cy.contains("a", "Manage Funds").click();
cy.url().should("contain", "DonationFundEditor.php");
});

it("should navigate to settings from Church Information checklist item", () => {
cy.visit("/finance/");

// Find the Settings button in the Church Information row
cy.contains("Church Information")
.parents(".list-group-item")
.find("a")
.contains("Settings")
.click();

cy.url().should("contain", "SystemSettings.php");
});

it("should link deposits checklist to FindDepositSlip", () => {
cy.visit("/finance/");

// Find the View button in the Close All Deposits row
cy.contains("Close All Deposits")
.parents(".list-group-item")
.find("a")
.contains("View")
.click();

cy.url().should("contain", "FindDepositSlip.php");
});
});

describe("Finance Dashboard - Standard User Access", () => {
beforeEach(() => {
cy.setupStandardSession();
});

it("should allow standard users with finance permission to access the dashboard", () => {
// The standard test user (tony.wade) has finance permissions enabled in demo database
cy.visit("/finance/");

// Should be able to see the dashboard
cy.get("h1").should("contain", "Finance Dashboard");

// Metrics should be visible
cy.get(".finance-metric-card").should("have.length.at.least", 3);
});
});

describe("Finance Dashboard - No Finance Permission", () => {
beforeEach(() => {
cy.setupNoFinanceSession();
});

it("should deny access to users without finance permission", () => {
// User judith.matthews has no finance permission
cy.visit("/finance/", { failOnStatusCode: false });

// Should be redirected to access-denied page
cy.url().should("include", "/v2/access-denied");
cy.url().should("include", "role=Finance");
});

it("should deny access to finance reports for users without finance permission", () => {
cy.visit("/finance/reports", { failOnStatusCode: false });

// Should be redirected to access-denied page
cy.url().should("include", "/v2/access-denied");
cy.url().should("include", "role=Finance");
});
});
24 changes: 24 additions & 0 deletions cypress/e2e/ui/finance/finance.deposits.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ describe("Finance Deposits", () => {
cy.contains("Envelope Manager");
});

it("Navigate to deposits from Finance Dashboard", () => {
cy.visit("/finance/");
cy.contains("Finance Dashboard");

// Click Create Deposit from Quick Actions
cy.contains("a", "Create Deposit").click();
cy.url().should("contain", "FindDepositSlip.php");
cy.contains("Deposit Listing");
});

it("Navigate to deposits from Finance Menu", () => {
cy.visit("/finance/");

// Use the View All link in Recent Deposits section
cy.contains("Recent Deposits")
.parents(".card")
.find("a")
.contains("View All")
.click();

cy.url().should("contain", "FindDepositSlip.php");
cy.contains("Deposit Listing");
});

it("Create a new Deposit without comment", () => {
cy.visit("/FindDepositSlip.php");
cy.get("#depositComment").clear();
Expand Down
133 changes: 133 additions & 0 deletions cypress/e2e/ui/finance/finance.reports-index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/// <reference types="cypress" />

/**
* Finance Reports Index Page Tests
*
* Tests for the new /finance/reports page with organized report categories.
* This page provides links to the legacy FinancialReports.php report generator
* with better organization and descriptions.
*/

describe("Finance Reports Index", () => {
beforeEach(() => {
cy.setupAdminSession();
});

it("should load the reports index page", () => {
cy.visit("/finance/reports");
cy.contains("Financial Reports");
cy.contains("Generate reports for tax statements");
});

it("should display Tax & Giving Reports section", () => {
cy.visit("/finance/reports");

cy.contains("Tax & Giving Reports");
cy.contains("Giving Report (Tax Statements)");
cy.contains("Zero Givers");
});

it("should display Pledge Reports section", () => {
cy.visit("/finance/reports");

cy.contains("Pledge Reports");
cy.contains("Pledge Summary");
cy.contains("Pledge Family Summary");
cy.contains("Pledge Reminders");
});

it("should display Deposit Reports section", () => {
cy.visit("/finance/reports");

cy.contains("Deposit Reports");
cy.contains("Individual Deposit Report");
cy.contains("Advanced Deposit Report");
});

it("should display Membership Reports section", () => {
cy.visit("/finance/reports");

cy.contains("Membership Reports");
cy.contains("Voting Members");
});

it("should display Report Tips section", () => {
cy.visit("/finance/reports");

cy.contains("Report Tips");
cy.contains("Fiscal Year");
cy.contains("Export Options");
cy.contains("Filtering");
});

it("should navigate to Giving Report from link", () => {
cy.visit("/finance/reports");

cy.contains("Giving Report (Tax Statements)").click();
cy.url().should("contain", "FinancialReports.php");
cy.url().should("contain", "Giving");
cy.contains("Financial Reports");
});

it("should navigate to Zero Givers from link", () => {
cy.visit("/finance/reports");

cy.contains("Zero Givers").click();
cy.url().should("contain", "FinancialReports.php");
cy.url().should("contain", "Zero");
});

it("should navigate to Pledge Summary from link", () => {
cy.visit("/finance/reports");

cy.contains("h6", "Pledge Summary").click();
cy.url().should("contain", "FinancialReports.php");
cy.url().should("contain", "Pledge%20Summary");
});

it("should navigate to Advanced Deposit Report from link", () => {
cy.visit("/finance/reports");

cy.contains("Advanced Deposit Report").click();
cy.url().should("contain", "FinancialReports.php");
cy.url().should("contain", "Advanced");
});

it("should navigate to Voting Members from link", () => {
cy.visit("/finance/reports");

cy.contains("Voting Members").click();
cy.url().should("contain", "FinancialReports.php");
cy.url().should("contain", "Voting");
});
});

describe("Finance Reports Index - Standard User Access", () => {
beforeEach(() => {
cy.setupStandardSession();
});

it("should allow standard users with finance permission to access reports", () => {
// The standard test user (tony.wade) has finance permissions enabled in demo database
cy.visit("/finance/reports");

// Should be able to see the reports page
cy.contains("Tax & Giving Reports").should("be.visible");
cy.contains("Pledge Reports").should("be.visible");
});
});

describe("Finance Reports Index - No Finance Permission", () => {
beforeEach(() => {
cy.setupNoFinanceSession();
});

it("should deny access to users without finance permission", () => {
// User judith.matthews has no finance permission
cy.visit("/finance/reports", { failOnStatusCode: false });

// Should be redirected to access-denied page
cy.url().should("include", "/v2/access-denied");
cy.url().should("include", "role=Finance");
});
});
17 changes: 17 additions & 0 deletions cypress/e2e/ui/finance/finance.reports.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ describe("Financial Reports", () => {
cy.setupAdminSession();
});

it("Navigate to Financial Reports from Dashboard", () => {
cy.visit("/finance/");
cy.contains("Finance Dashboard");

// Click Generate Reports from Quick Actions
cy.contains("a", "Generate Reports").click();
cy.url().should("contain", "/finance/reports");
cy.contains("Financial Reports");
});

it("Navigate to Giving Report from Reports Index", () => {
cy.visit("/finance/reports");
cy.contains("Giving Report (Tax Statements)").click();
cy.url().should("contain", "FinancialReports.php");
cy.contains("Financial Reports");
});

it("Giving Report", () => {
cy.visit("FinancialReports.php");
cy.contains("Financial Reports");
Expand Down
6 changes: 6 additions & 0 deletions cypress/support/commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ declare namespace Cypress {
*/
setupStandardSession(options?: { forceLogin?: boolean }): Chainable<void>;

/**
* Ensure a no-finance user session is active (optionally forcing a fresh login)
* Used to test that finance pages correctly deny access to non-finance users
*/
setupNoFinanceSession(options?: { forceLogin?: boolean }): Chainable<void>;

/**
* Wait for page to be fully loaded
*/
Expand Down
Loading
Loading