Fixes #39386 - replace snapshot test for taskdashboardreducer#825
Open
andreilakatos wants to merge 1 commit into
Open
Fixes #39386 - replace snapshot test for taskdashboardreducer#825andreilakatos wants to merge 1 commit into
andreilakatos wants to merge 1 commit into
Conversation
1f0e30b to
9af638f
Compare
There was a problem hiding this comment.
Pull request overview
Replaces the snapshot-based unit test for TasksDashboardReducer with explicit state assertions, and removes the now-unused Jest snapshot file. This aligns the test intent more closely with reducer behavior and makes failures more targeted (per issue #39386).
Changes:
- Rewrote
TasksDashboardReducer.test.jsfrom snapshot fixtures to explicittoEqualassertions per action. - Removed the Jest snapshot file that was only used by the prior snapshot-based test approach.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| webpack/ForemanTasks/Components/TasksDashboard/tests/TasksDashboardReducer.test.js | Replaces snapshot fixture testing with explicit reducer state assertions. |
| webpack/ForemanTasks/Components/TasksDashboard/tests/snapshots/TasksDashboardReducer.test.js.snap | Removes obsolete snapshots after switching away from snapshot tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+22
| it('should return the initial state', () => { | ||
| expect(reducer(undefined, {})).toEqual(initialState); |
Comment on lines
+25
to
+30
| it('should handle FOREMAN_TASKS_DASHBOARD_INIT', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_INIT, | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+36
to
+42
| it('should handle FOREMAN_TASKS_DASHBOARD_INIT with data', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_INIT, | ||
| payload: { time: 'some-time', query: 'some-query' }, | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+49
to
+55
| it('should handle FOREMAN_TASKS_DASHBOARD_UPDATE_TIME', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_UPDATE_TIME, | ||
| payload: 'some-time', | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+61
to
+67
| it('should handle FOREMAN_TASKS_DASHBOARD_UPDATE_QUERY', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_UPDATE_QUERY, | ||
| payload: 'some-query', | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+73
to
+78
| it('should handle FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_REQUEST', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_REQUEST, | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+84
to
+90
| it('should handle FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_SUCCESS', () => { | ||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_SUCCESS, | ||
| payload: 'some-payload', | ||
| }) | ||
| ).toEqual({ |
Comment on lines
+98
to
+106
| it('should handle FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_FAILURE', () => { | ||
| const error = new Error('some error'); | ||
|
|
||
| expect( | ||
| reducer(undefined, { | ||
| type: FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY_FAILURE, | ||
| payload: error, | ||
| }) | ||
| ).toEqual({ |
Lukshio
reviewed
Jun 4, 2026
Contributor
Lukshio
left a comment
There was a problem hiding this comment.
some-query can be easily changed to actual query which can help catch some issues in future
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.