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

chore(history): add api tests #20157

Merged
merged 6 commits into from Apr 23, 2024
Merged

chore(history): add api tests #20157

merged 6 commits into from Apr 23, 2024

Conversation

markkaylor
Copy link
Contributor

@markkaylor markkaylor commented Apr 19, 2024

What does it do?

  • Add API tests for content history
  • Remove controller unit tests now covered by API tests

Fixes the following:

  • Adjust collectionType param check in history controller
  • Fallback to defaultLocale when calling findMany versions
  • Redirect on restore without documentId for single types
  • Single types cache invalidation

Why is it needed?

  • To test all endpoints behave as expected

How to test it?

STRAPI_LICENSE=<your-license-with-history> yarn test:api tests/api/core/content-manager/content-manager/history/history.test.api.ts

@markkaylor markkaylor added source: tooling Source is GitHub tooling/tests/ect pr: chore This PR contains chore tasks (cleanups, configs, tooling...) labels Apr 19, 2024
@markkaylor markkaylor self-assigned this Apr 19, 2024
Copy link

vercel bot commented Apr 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 1:57pm

Copy link
Contributor

@remidej remidej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this! It should give us more confidence than all the mocks.

It all looks good to me, but I never worked on API tests, so it would be better if someone could review that part more closely

@markkaylor markkaylor merged commit bdaafbb into v5/main Apr 23, 2024
50 of 83 checks passed
@markkaylor markkaylor deleted the v5/history-api-tests branch April 23, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: tooling Source is GitHub tooling/tests/ect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants