chore: make test less flaky (#1038)

This commit is contained in:
Nolan Lawson 2019-02-23 12:32:10 -08:00 committed by GitHub
parent 547ee14f88
commit 31a6ec6857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -75,9 +75,12 @@ test('notification timeline preserves focus', async t => {
})
test('thread preserves focus', async t => {
const timeout = 30000
await loginAsFoobar(t)
await t
.navigateTo('/accounts/3')
.expect(getNthStatus(0).exists).ok({ timeout })
.hover(getNthStatus(0))
await scrollToStatus(t, 2)
await t.click(getNthStatus(2))
@ -91,12 +94,12 @@ test('thread preserves focus', async t => {
.expect(getActiveElementInsideNthStatus()).eql('24')
.hover(getNthStatus(23))
.click(getNthStatus(23))
.expect($(`${getNthStatusSelector(23)} .status-absolute-date`).exists).ok()
.expect($(`${getNthStatusSelector(23)} .status-absolute-date`).exists).ok({ timeout })
await goBack()
await t.expect($(`${getNthStatusSelector(24)} .status-absolute-date`).exists).ok()
.expect(getActiveElementClassList()).contains('status-article')
.expect(getActiveElementClassList()).contains('status-in-timeline')
.expect(getActiveElementInsideNthStatus()).eql('23')
await t.expect($(`${getNthStatusSelector(24)} .status-absolute-date`).exists).ok({ timeout })
.expect(getActiveElementClassList()).contains('status-article', { timeout })
.expect(getActiveElementClassList()).contains('status-in-timeline', { timeout })
.expect(getActiveElementInsideNthStatus()).eql('23', { timeout })
})
test('reply preserves focus and moves focus to the text input', async t => {