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

Streamline the test scripts #194

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Streamline the test scripts #194

merged 2 commits into from
Jan 9, 2025

Conversation

rcantin-w
Copy link
Contributor

@rcantin-w rcantin-w commented Jan 8, 2025

What does this change?

Gareth's work here, where he rightly reused existing helpers made me realise that we were repeating some logic and defaults IDs at various points. I wanted to streamline it, make it potentially easier to add new types to (although when will that ever happen 😄 ). Would recommend reviewing without whitespace.

  • Streamlines the test scripts to have one source of truth for default IDs
  • Fixes the allowedtypes type, which wasn't working, we could enter whatever value and it would work

I do think it helps with readability and maintainability as well.

How to test

Run some tests scripts, see if it's expected results!
Run update-prismic-snapshot to see if it still works as expected.

How can we measure success?

Typescript is actually useful and we can add types/modify the tests/default IDs easily and in one place.

Have we considered potential risks?

This is mostly for testing purposes, but it also affected update-prismic-snapshot, so there could be that, although the only change is a check if the type isn't valid. I re-ran the snapshots locally and it looks alright to me.

@rcantin-w rcantin-w self-assigned this Jan 8, 2025
@rcantin-w rcantin-w marked this pull request as ready for review January 8, 2025 14:55
@rcantin-w rcantin-w requested a review from a team as a code owner January 8, 2025 14:55
@rcantin-w rcantin-w merged commit 14c46ca into main Jan 9, 2025
4 checks passed
@rcantin-w rcantin-w deleted the streamline-test-scripts branch January 9, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Archive
Development

Successfully merging this pull request may close these issues.

2 participants