chore: Add test for block mover (#8011)#8392
Conversation
|
|
||
| describe( 'block mover', () => { | ||
| beforeEach( async () => { | ||
| await newDesktopBrowserPage(); |
There was a problem hiding this comment.
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.
Probably not but I'll double-check.
There was a problem hiding this comment.
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.
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.
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.
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 😄