Skip to content

test: add explicit mock_ask_confirmation call assertions to reset workflow tests#1350

Merged
amilcarlucas merged 2 commits intoSID_AXISfrom
copilot/sub-pr-1348
Mar 4, 2026
Merged

test: add explicit mock_ask_confirmation call assertions to reset workflow tests#1350
amilcarlucas merged 2 commits intoSID_AXISfrom
copilot/sub-pr-1348

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Tests for upload_parameters_that_require_reset_workflow set up mock_ask_confirmation but never asserted whether it was invoked, leaving the confirmation callback behavior untested and vulnerable to silent regressions.

Changes

  • Reset-triggering cases (SID_AXIS 0→non-zero, absent→non-zero): added mock_ask_confirmation.assert_called_once() — these paths hit reset_unsure_params and must prompt the user
  • Non-reset cases (SID_AXIS non-zero→non-zero, non-zero→zero): added mock_ask_confirmation.assert_not_called() — no reset path is entered, dialog must not appear
  • Error case (upload raises ValueError): added mock_ask_confirmation.assert_not_called() — exception is caught before any reset logic, dialog must not appear
# Reset-triggering test now verifies the prompt fires exactly once
assert reset_happened is True
assert "SID_AXIS" in uploaded_params
mock_ask_confirmation.assert_called_once()   # ← added
mock_show_error.assert_not_called()

# Non-reset test now verifies the prompt is suppressed
assert reset_happened is False
mock_ask_confirmation.assert_not_called()    # ← added
mock_show_error.assert_not_called()

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: amilcarlucas <24453563+amilcarlucas@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix FC reset behavior in parameter editor refactor test: add explicit mock_ask_confirmation call assertions to reset workflow tests Mar 4, 2026
@amilcarlucas amilcarlucas marked this pull request as ready for review March 4, 2026 12:16
@amilcarlucas amilcarlucas self-requested a review as a code owner March 4, 2026 12:16
@amilcarlucas amilcarlucas merged commit 34ac513 into SID_AXIS Mar 4, 2026
24 of 28 checks passed
@amilcarlucas amilcarlucas deleted the copilot/sub-pr-1348 branch March 4, 2026 13:35
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