Skip to content

chore: Add test for block mover (#8011)#8392

Merged
tofumatt merged 3 commits intomasterfrom
chore/test-for-8011
Aug 7, 2018
Merged

chore: Add test for block mover (#8011)#8392
tofumatt merged 3 commits intomasterfrom
chore/test-for-8011

Conversation

@tofumatt
Copy link
Copy Markdown
Member

@tofumatt tofumatt commented Aug 2, 2018

Description

Adds e2e tests for the change made in #8011.

How has this been tested?

It's a test 😄


describe( 'block mover', () => {
beforeEach( async () => {
await newDesktopBrowserPage();
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member Author

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...

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

@jorgefilipecosta jorgefilipecosta left a 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 👍

@tofumatt tofumatt force-pushed the chore/test-for-8011 branch 2 times, most recently from 52574d1 to 10979b9 Compare August 7, 2018 22:50
@tofumatt tofumatt force-pushed the chore/test-for-8011 branch from 10979b9 to b3e0acc Compare August 7, 2018 23:05
@tofumatt tofumatt merged commit 47a69e1 into master Aug 7, 2018
@tofumatt tofumatt deleted the chore/test-for-8011 branch August 7, 2018 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants