Skip to content

refact: Refactor snapshot tests to conditionally skip based on options#7685

Merged
deleonio merged 1 commit intodevelopfrom
7251-v3
May 12, 2025
Merged

refact: Refactor snapshot tests to conditionally skip based on options#7685
deleonio merged 1 commit intodevelopfrom
7251-v3

Conversation

@deleonio
Copy link
Copy Markdown
Contributor

@deleonio deleonio commented May 12, 2025

This pull request refines the visual testing logic in theme-snapshots.spec.js by introducing more granular control over snapshot options and skipping unnecessary tests. The changes improve test efficiency and maintainability by organizing snapshot-related configurations under a snapshot object.

Improvements to snapshot test logic:

  • Added conditional logic to skip unnecessary tests: Introduced checks to skip both normal and zoom snapshot tests if the skip flag is set in the snapshot configuration. This avoids running redundant tests. [1] [2]

  • Refined viewport and timeout handling: Updated the code to pull viewportSize and waitForTimeout values from the snapshot configuration, ensuring these settings are scoped specifically to snapshot-related options.

  • Improved snapshot option merging: Replaced the direct use of DEFAULT_SNAPSHOT_OPTIONS with a new SNAPSHOT_OPTIONS object that merges default options with specific snapshot-scoped configurations. This makes the code more modular and easier to extend.

  • Enhanced zoom test options: Added support for merging additional zoom-specific options into the snapshot configuration, enabling more flexibility for zoom tests.

The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer:

  • Meaningful pull request title for the release notes
  • Pull request is linked to an issue and all changes relate to the issue
  • Tests to protect this code implemented (if applicable)
  • Manual test performed successfully (if applicable)
  • Documentation or migration has been updated (if applicable)

@deleonio deleonio changed the title refact: refactor snapshot tests to streamline options handling and sk… refact: Refactor snapshot tests to conditionally skip based on options May 12, 2025
@deleonio deleonio linked an issue May 12, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

Netlify Draft Deployment
URL:
Logs:

@deleonio deleonio merged commit 6acabd2 into develop May 12, 2025
9 checks passed
@deleonio deleonio deleted the 7251-v3 branch May 12, 2025 12:51
@publicuibot publicuibot bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visuelle Tests: Snapshots reduzieren

1 participant