storyblok / field-plugin

Create and deploy Storyblok Field Plugin
https://www.storyblok.com/docs/plugins/field-plugins/introduction
25 stars 3 forks source link

feat(common): add test helper #307

Closed eunjae-lee closed 8 months ago

eunjae-lee commented 9 months ago

What?

This PR is a proof of concept for the test helper.

Why?

JIRA: EXT-2048

After creating a field plugin, users need a way to test their field plugins. Currently the field plugin is meant to be used with a container (Field Type Editor, Visual Editor, or the Sandbox). This makes it harder to write integration tests to test the components. So this proof of concept shows how to mock necessary parts of window, so that the field plugin can run with a fake (memory) container, which enables testing.

How to test? (optional)

vercel[bot] commented 9 months ago

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

Name Status Preview Comments Updated (UTC)
plugin-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 1, 2023 9:17am
eunjae-lee commented 9 months ago

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

BibiSebi commented 9 months ago

Great job @eunjae-lee. I like how you approached this problem 👍 I left some minor comments on code readability, even though this is just a draft PR and I am sure you would cover them anyway 💯