Skip to content

#1411 - Add email template e2e coverage - #1426

Merged
brijesh-amin merged 2 commits into
devfrom
feature/1411-email-template-e2e
Sep 28, 2026
Merged

brijesh-amin merged 2 commits into
devfrom
feature/1411-email-template-e2e

Conversation

@brijesh-amin

Copy link
Copy Markdown
Collaborator

Covers #1411 (e2e: email template save/update).

Tests (playwright/e2e/email-template.spec.ts, 6 specs)

  • Email Template nav link gated on manage-email-templates permission (revoke/re-grant round-trip)
  • Admin-only route guard for non-admin staff
  • Template list + select loads form values
  • Edit + save persists via API and across reload
  • Unsaved edits discarded on template switch
  • PUT failure surfaces error toast, DB row unchanged

Prod change

  • src/components/emailTemplatePage/index.tsx: accessible ids/labels for test selectors only, plus one-word typo fix (temaplate -> template). No behavior change.

Verification

  • 6/6 pass locally; tsc, eslint, prettier clean.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Test cleanup leaves the shared E2E account with elevated Admin privileges.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds end-to-end coverage for the admin email-template workflow.

Changes:

  • Adds six Playwright scenarios for access, editing, persistence, and failures.
  • Adds database/API test helpers.
  • Improves form accessibility labels and fixes an error-message typo.
File Description
src/​components/​emailTemplatePage/​index.tsx Adds accessible selectors and fixes typo.
playwright/​e2e/​support/​emailTemplateRuntime.ts Adds email-template E2E utilities.
playwright/​e2e/​email-template.spec.ts Adds six workflow tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread playwright/e2e/email-template.spec.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused production updates and comprehensive end-to-end coverage are consistent and contain no identified blocking issues.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@brijesh-amin
brijesh-amin merged commit 8f7f4b6 into dev Sep 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants