Skip to content

Tests: Improve resource sorting assertions - #1264

Merged
n7studios merged 22 commits into
mainfrom
tests-resource-order-assertion
Oct 30, 2026
Merged

n7studios merged 22 commits into
mainfrom
tests-resource-order-assertion

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Resource tests asserted hard-coded first and last resource names, failing when the Kit test account has additional Tags, Sequences etc. (e.g. ResourceSequencesTest::testGetWithInvalidOrderBy, RefreshResourcesButtonCest::testRefreshResourcesInClassicEditor).

Mirrors the approach in convertkit-wordpress-libraries:

  • Integration: ResourceAssertionsTrait with assertResourcesSorted() (sorted by order_by / order, using strcmp as the resource class does) and assertResourcesInOriginalOrder() (for invalid order_by), used by all Resource*Test classes.
  • EndToEnd: checkSelectFormOptionOrder(), checkSelectLandingPageOptionOrder() and checkSelectTagOptionOrder() now assert prepended options are first and all resources are sorted, instead of checking hard-coded first / last options.

Existing assertions that .env resources exist are unchanged.

Checklist

@n7studios n7studios self-assigned this Oct 28, 2026
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios marked this pull request as ready for review October 28, 2026 13:18
@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team October 28, 2026 13:18
Broadcasts: Export: Use Featured Image as Thumbnail
Broadcasts: Export: Greeting, Sign-off and Read on the Web settings
Broadcasts: Export: Use Post Excerpt as Preview Text
Broadcasts: Rename Creator Profile to Newsletter site
@n7studios
n7studios merged commit d7c1349 into main Oct 30, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants