-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Post Status: Add component tests #8128
Conversation
import useFakeDom from 'test/helpers/use-fake-dom'; | ||
|
||
describe( 'PostStatus', ( ) => { | ||
useFakeDom(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we don't actually need this, so this and the matching import can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, removed.
5b3e73b
to
88c368c
Compare
LGTM 👍 |
describe( 'PostStatus', ( ) => { | ||
let PostStatus; | ||
|
||
before( ( ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No filler spaces in empty constructs (e.g.,
{}
,[]
,fn()
).
Will have to see if we can get an ESLint rule to enforce this.
There's several instances of this through the file.
let PostStatus; | ||
|
||
before( ( ) => { | ||
PostStatus = require( '..' ).PostStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can import this at top-of-file now. You'd only have needed it if you had some other test helpers which were prerequisites to be defined before the component itself (e.g. fake DOM, mockery, etc). Should help clean things up a bit.
This PR adds tests for the Post Status component as described in #7942.
To test, run
npm run test-client client/blocks/post-status/
and verify that all of the tests pass.Additionally, review the Post Status component and ensure that the test covers all of the relevant conditions.