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

Testing: Add e2e tests for Plugins API #7269

Merged
merged 1 commit into from
Jun 12, 2018
Merged

Testing: Add e2e tests for Plugins API #7269

merged 1 commit into from
Jun 12, 2018

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Jun 11, 2018

Description

This PR adds basic end-to-end tests for the PluginSidebar and PluginSidebarMoreMenuItem registration. I plan to add more tests in this area to make sure other aspects work as expected, as well as other components, they integrate properly.

How has this been tested?

npm run test-e2e and Travis verification should be green.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Feature] Extensibility The ability to extend blocks or the editing experience labels Jun 11, 2018
@gziolo gziolo self-assigned this Jun 11, 2018
@gziolo gziolo requested review from mcsf, youknowriad and aduth June 11, 2018 16:35
@gziolo gziolo force-pushed the add/plugins-api-e2e branch from ebcff87 to 08215ad Compare June 11, 2018 16:37
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

await toggleMoreMenuItem( 'My title plugin' );

const pluginSidebarContent = await page.$eval( '.edit-post-sidebar', ( el ) => el.innerHTML );
expect( pluginSidebarContent ).toMatchSnapshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how I feel about snapshotting the whole sidebar? Can't we target something more specific, for example, check that the title changes with the post title in the editor?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will open another PR soon :)
I want more tests!!!

@gziolo gziolo merged commit 01a0e06 into master Jun 12, 2018
@gziolo gziolo deleted the add/plugins-api-e2e branch June 12, 2018 09:04
@gziolo gziolo added the [Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API label Jun 12, 2018
@gziolo gziolo added this to the 3.1 milestone Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants