-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
chore: Add test for block mover (#8011) #8392
Conversation
|
||
describe( 'block mover', () => { | ||
beforeEach( async () => { | ||
await newDesktopBrowserPage(); |
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.
Normally we open a page for all the tests e.g: await newDesktopBrowserPage(); is in a before all block and not in a beforeEach block. Was there any special reason for this difference? Can the newDesktopBrowserPage call be in a beforeAll block?
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.
Probably not but I'll double-check.
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.
Ah, scratch that; we need an empty post for each test. If we use beforeAll
we don't have a clean slate that we need to know how many blocks are there.
Our tests in the past use beforeAll
possibly for speed? The globals in the tests are kinda weird... anyway, this needs a fresh state for each test so beforeEach
it is...
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.
But if we use newDesktopBrowserPage in beforeAll and newPost in beforeEach don't we get a fresh state on each test? We will just reuse the same tab but we start with an empty post on each test.
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 tried that out locally and it seemed to hang. I'll give it another go though, I just realised my environment could have been messed up locally from an unstashed, unrelated change.
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.
Thank you for adding this test case @tofumatt the code makes sense to me and test passed when I executed them 👍
52574d1
to
10979b9
Compare
10979b9
to
b3e0acc
Compare
Description
Adds e2e tests for the change made in #8011.
How has this been tested?
It's a test 😄