Skip to content

test: complete manager change end-to-end workflow with confirmation - #378

Open
mrofreP wants to merge 1 commit into
UndernetIRC:masterfrom
mrofreP:test/enable-manager-change-email-confirmation-workflow
Open

mrofreP wants to merge 1 commit into
UndernetIRC:masterfrom
mrofreP:test/enable-manager-change-email-confirmation-workflow

Conversation

@mrofreP

@mrofreP mrofreP commented Jul 18, 2026

Copy link
Copy Markdown

TestManagerChange_EndToEndWorkflow/complete_manager_change_workflow
verified steps 1-3 (request creation, email delivery via mailpit,
status endpoint) and then stopped at step 4 with:

t.Log("Skipping confirmation step - panic in ConfirmManagerChange
needs separate fix")

The referenced panic is unrelated to this workflow — server-generated
tokens are always long enough to slice safely — so the workflow can
be completed without waiting on that fix.

Extend the test with steps 4 and 5:

  • Step 4: read the confirmation token directly from pending_mgrchange
    via dbPool.QueryRow (parsing it out of the mailpit HTML would be
    fragile), then drive GET /channels/:id/manager-confirm?token=... and
    assert 200 + status=confirmed + change_type=temporary in the
    response body.
  • Step 5: verify the DB row's confirmed column is now '1'.

Net effect: the manager-change happy path is now covered end-to-end
against a real Postgres + real mailpit, closing the loop from
submission through email delivery to confirmation.

TestManagerChange_EndToEndWorkflow/complete_manager_change_workflow
verified steps 1-3 (request creation, email delivery via mailpit,
status endpoint) and then stopped at step 4 with:

    t.Log("Skipping confirmation step - panic in ConfirmManagerChange
    needs separate fix")

The referenced panic is unrelated to this workflow — server-generated
tokens are always long enough to slice safely — so the workflow can
be completed without waiting on that fix.

Extend the test with steps 4 and 5:

- Step 4: read the confirmation token directly from pending_mgrchange
  via dbPool.QueryRow (parsing it out of the mailpit HTML would be
  fragile), then drive GET /channels/:id/manager-confirm?token=... and
  assert 200 + status=confirmed + change_type=temporary in the
  response body.
- Step 5: verify the DB row's confirmed column is now '1'.

Net effect: the manager-change happy path is now covered end-to-end
against a real Postgres + real mailpit, closing the loop from
submission through email delivery to confirmation.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant