Skip to content

Conversation

tomasstrba
Copy link
Contributor

@tomasstrba tomasstrba commented Oct 14, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1148564399326804/task/1211575849635044?focus=true
CC:

Description

Adding tests for new NTP state management

Note: I time-boxed adding UI tests, but was blocked on reliably locating the search box. Since there are no tests for NTP for now, I decided to skip the test. There is a new initiative to deliver e2e tests for each feature, so I expect NTP will be raised and discussed there.

Testing Steps

  1. Make sure unit tests pass

Impact and Risks

None: Internal tooling, documentation


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Adds focused unit tests for NewTabPageStateProvider covering feature-flag gating and Combine publisher/state behavior.

  • Tests (macOS):
    • New: macOS/UnitTests/NewTabPage/NewTabPageStateProviderTests.swift.
    • Coverage:
      • Feature flags: verifies newTabPageTabIDs vs newTabPagePerTab gating for getState() and publisher emissions.
      • State collection: ensures empty state when no windows; non-nil only when correctly enabled.
      • Publisher behavior: emits on tab changes, filtered when disabled/per-tab, delivered on main queue.
      • Dynamic flags: re-checks flags at runtime for both publisher and getState(), maintaining consistency after enable/disable transitions.

Written by Cursor Bugbot for commit 55c30b8. This will update automatically on new commits. Configure here.

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 15:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit tests for the new NewTabPageStateProvider class to test state management functionality for the New Tab Page feature. The tests cover feature flag behavior, state collection, publisher functionality, and dynamic feature flag changes.

  • Feature flag tests to validate behavior when different combinations of flags are enabled/disabled
  • Publisher tests to ensure proper emission and filtering based on feature flags
  • Dynamic feature flag tests to verify that flag changes are respected at runtime

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tomasstrba tomasstrba changed the title NewTabPageStateProviderTests.swift NewTabPageStateProviderTests Oct 16, 2025
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