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(core): add copy paste e2e tests #6935

Merged
merged 29 commits into from
Jun 26, 2024

Conversation

sjelfull
Copy link
Member

@sjelfull sjelfull commented Jun 14, 2024

Description

This adds e2e component tests for verifying that copy & pasting works, both via keyboard shortcuts and field actions.

This currently tests object inputs in the interest of time, but we could extend it to cover all inputs later.

Testing clipboard in playwright is tricky, so we have added a fixture that mocks the clipboard. This retains any copied value only on the same page, so it will reset if you change it to navigate away to another document.

The fixture might make sense to lift to the @sanity/test package if we feel its generic enough.

What to review

  • That the scenarios makes sense

@sjelfull sjelfull self-assigned this Jun 14, 2024
Copy link

vercel bot commented Jun 14, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:34pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:34pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:34pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:34pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:34pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jun 25, 2024 5:34pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Jun 14, 2024

Component Testing Report Updated Jun 25, 2024 5:44 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 42s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 36s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ❌ Failed (Inspect) 23s 7 4 1
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 52s 1 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 44s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 44s 18 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 15s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 25s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 35s 12 0 0

@sjelfull sjelfull force-pushed the feat/global-copy-paste-tests branch from dc3e74b to 975acb3 Compare June 17, 2024 20:34
@sjelfull sjelfull force-pushed the feat/global-copy-paste-tests branch from 2b8cb19 to d099f34 Compare June 18, 2024 09:50
@sjelfull sjelfull force-pushed the feat/global-copy-paste-tests branch from d099f34 to 80db8c3 Compare June 18, 2024 09:57
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
Signed-off-by: Fred Carlsen <fred@sjelfull.no>
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.

None yet

1 participant