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

test(migration) add tests for normalizeMigrationDefinition #5565

Merged

Conversation

binoy14
Copy link
Contributor

@binoy14 binoy14 commented Jan 25, 2024

Description

Adds test for normalizeMigrationDefinition function

What to review

Not 100% sure if it makes sense and is testing the full capability of the functions, @bjoerge thoughts?

Testing

Added :)

Notes for release

N/A

@binoy14 binoy14 requested a review from a team as a code owner January 25, 2024 16:37
@binoy14 binoy14 requested review from jtpetty and removed request for a team January 25, 2024 16:37
Copy link

vercel bot commented Jan 25, 2024

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

Name Status Preview Comments Updated (UTC)
performance-studio ❌ Failed (Inspect) Feb 1, 2024 10:50pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2024 10:50pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2024 10:50pm

Copy link
Contributor

github-actions bot commented Jan 25, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Jan 25, 2024

Component Testing Report Updated Feb 1, 2024 10:54 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 18s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 1s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

I think it would be nice to assert a couple of more cases:

  • Calling the normalized function of node migration hooks resolves to a list of the returned mutations
  • Returning nothing/void from an async node migration doesn't include undefined in the final list of mutations

@binoy14 binoy14 force-pushed the 01-25-test_migration_add_tests_for_normalizeMigrationDefinition branch from 1ed416a to cc2b5d1 Compare January 29, 2024 15:53
@bjoerge bjoerge force-pushed the feat/migration-runner branch 2 times, most recently from be0d838 to c9563a3 Compare January 29, 2024 23:49
@bjoerge bjoerge force-pushed the feat/migration-runner branch from da7e0ad to 2e77de7 Compare January 30, 2024 19:27
Base automatically changed from feat/migration-runner to next January 30, 2024 19:38
@bjoerge bjoerge force-pushed the next branch 2 times, most recently from 958869d to 6fa1750 Compare February 1, 2024 10:53
})
})

describe('#createAsyncIterableMutation', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this test just testing that we follow an interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the most part it just ensures that it is returns an iterable. normalizeMigrateDefinition internally calls this function so the above tests do actually test most of it's functionality

@binoy14 binoy14 added this pull request to the merge queue Feb 16, 2024
Merged via the queue into next with commit c4baaab Feb 16, 2024
40 of 41 checks passed
@binoy14 binoy14 deleted the 01-25-test_migration_add_tests_for_normalizeMigrationDefinition branch February 16, 2024 13:51
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.

3 participants