Skip to content

Add ChangedEvent signal tests for SettingsVariable#597

Merged
dpaulat merged 2 commits intofeature/map-provider-and-api-key-hot-changefrom
copilot/sub-pr-596
Mar 8, 2026
Merged

Add ChangedEvent signal tests for SettingsVariable#597
dpaulat merged 2 commits intofeature/map-provider-and-api-key-hot-changefrom
copilot/sub-pr-596

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

The ChangedEvent<T> API introduced for changed_signal() and staged_signal() (carrying oldValue_/newValue_) had no test coverage verifying the event payload was correct.

Changes

  • ChangedEventSetValue — asserts both changed_signal and staged_signal emit the correct old/new values on a successful SetValue, and that neither fires on a failed (out-of-range) call.
  • ChangedEventSetValueToDefault — asserts both signals emit the correct old and new default values after SetValueToDefault.
  • ChangedEventStageAndCommit — asserts StageValue fires only staged_signal (not changed_signal), and that Commit fires both with the expected values.
intVariable.changed_signal().connect(
   [&](const ChangedEvent<int64_t>& event) { lastChangedEvent = event; });
intVariable.staged_signal().connect(
   [&](const ChangedEvent<int64_t>& event) { lastStagedEvent = event; });

ASSERT_TRUE(intVariable.SetValue(30));
EXPECT_EQ(lastChangedEvent->oldValue_, 20);
EXPECT_EQ(lastChangedEvent->newValue_, 30);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dpaulat <2886605+dpaulat@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on map provider and API key changes implementation Add ChangedEvent signal tests for SettingsVariable Mar 8, 2026
@dpaulat dpaulat marked this pull request as ready for review March 8, 2026 18:20
@dpaulat dpaulat merged commit 89c4399 into feature/map-provider-and-api-key-hot-change Mar 8, 2026
@dpaulat dpaulat deleted the copilot/sub-pr-596 branch March 8, 2026 18:20
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