Skip to content

Fixes #39378 - replace snapshot tests for taskaction component#822

Open
andreilakatos wants to merge 1 commit into
theforeman:masterfrom
andreilakatos:task-action-test-update
Open

Fixes #39378 - replace snapshot tests for taskaction component#822
andreilakatos wants to merge 1 commit into
theforeman:masterfrom
andreilakatos:task-action-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 addresses #39378 by replacing Jest snapshot-based tests for the TaskActions action creators with explicit assertion-based tests, improving clarity around dispatched actions/toasts and removing the associated snapshot file.

Changes:

  • Replaced testActionSnapshotWithFixtures snapshot tests with explicit dispatch/API.post assertions for cancel/resume/force-cancel/unlock flows.
  • Added direct expectations for action types and toast payloads for both success and failure paths.
  • Removed the now-unused Jest snapshot file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
webpack/ForemanTasks/Components/TaskActions/TaskAction.test.js Rewrites action tests to assert dispatch sequences, toast payloads, and API endpoints instead of relying on snapshots.
webpack/ForemanTasks/Components/TaskActions/snapshots/TaskAction.test.js.snap Deletes obsolete snapshots after moving away from snapshot-based testing.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants