Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: backfill tests for ContentBlockResolver #292

Merged
merged 9 commits into from
Oct 5, 2024

Conversation

Ta5r
Copy link
Contributor

@Ta5r Ta5r commented Sep 23, 2024

What

This PR backfills additional test cases for the ContentBlocksResolver class in ContentBlocksResolverTest.

How

The following test cases are included:

  • Pre-resolve Filter Test: test_pre_resolved_blocks_filter_returns_non_null ensures that the wpgraphql_content_blocks_pre_resolve_blocks filter correctly modifies the block content before the blocks are resolved.
  • Empty Content Test: test_returns_empty_array_for_empty_content checks that an empty array is returned when the post content is empty, ensuring proper behavior for posts with no blocks.
  • Post-resolve Filter Test: test_filters_wpgraphql_content_blocks_resolve_blocks ensures that the wpgraphql_content_blocks_resolve_blocks filter correctly modifies block content after the blocks are resolved.
  • Inner Block Test: test_inner_blocks tests resolution for both flat and nested blocks, including the correct parentClientIds are set, and that there are no discrepancies between flat/nested resolution.

Copy link

changeset-bot bot commented Sep 23, 2024

🦋 Changeset detected

Latest commit: a38e479

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wpengine/wp-graphql-content-blocks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Ta5r
Copy link
Contributor Author

Ta5r commented Sep 23, 2024

c.c @justlevine

@Ta5r Ta5r marked this pull request as ready for review September 23, 2024 09:24
@Ta5r Ta5r requested a review from a team as a code owner September 23, 2024 09:24
@jasonbahl jasonbahl merged commit 652a186 into wpengine:main Oct 5, 2024
10 of 11 checks passed
@justlevine justlevine deleted the test/refactor-ContentBlockResolver branch October 18, 2024 10:30
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