wp-graphql-content-blocks
wp-graphql-content-blocks copied to clipboard
tests: backfill tests for `ContentBlockResolver`
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 thewpgraphql_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 thewpgraphql_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 correctparentClientIds
are set, and that there are no discrepancies between flat/nested resolution.