Skip to content

Fixes #39387 - replace snapshot test for taskdashboardselectors#826

Open
andreilakatos wants to merge 1 commit into
theforeman:masterfrom
andreilakatos:tasks-dashboard-selectors-test-update
Open

Fixes #39387 - replace snapshot test for taskdashboardselectors#826
andreilakatos wants to merge 1 commit into
theforeman:masterfrom
andreilakatos:tasks-dashboard-selectors-test-update

Conversation

@andreilakatos
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

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 replaces a Jest snapshot-based selector test for the Tasks Dashboard with explicit assertions, making the selector behavior easier to understand and less brittle over time.

Changes:

  • Replaced testSelectorsSnapshotWithFixtures snapshot coverage with explicit it(...) unit tests for each selector.
  • Added explicit expectations for default selector behavior when the Redux state is empty.
  • Removed the obsolete snapshot output for TasksDashboardSelectors tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
webpack/ForemanTasks/Components/TasksDashboard/tests/TasksDashboardSelectors.test.js Rewrites selector tests from snapshot fixtures to explicit assertions (including empty-state defaults).
webpack/ForemanTasks/Components/TasksDashboard/tests/snapshots/TasksDashboardSelectors.test.js.snap Removes snapshot expectations that are no longer used after switching to explicit assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +106 to +108
it('should select query', () => {
expect(selectQuery(state)).toBe('some-query');
});
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.

This should be fixed

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.

3 participants