test: improve flakiness of emoji test (#1116)

This commit is contained in:
Nolan Lawson 2019-03-23 16:23:20 -07:00 committed by GitHub
parent a862191d12
commit 13659f544e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 15 deletions

View File

@ -1,7 +1,7 @@
import {
composeButton, composeInput, composeLengthIndicator, emojiButton, emojiSearchInput, getComposeSelectionStart,
getNthStatusContent, getUrl,
homeNavButton,
homeNavButton, modalDialog,
notificationsNavButton, sleep,
times
} from '../utils'
@ -93,24 +93,15 @@ test('inserts custom emoji correctly', async t => {
test('inserts emoji without typing anything', async t => {
await loginAsFoobar(t)
await sleep(1000)
await t
.click(emojiButton)
await sleep(1000)
await t
.expect(emojiSearchInput.value).eql('')
.typeText(emojiSearchInput, 'blobpats', { paste: true })
await sleep(1000)
await t
.pressKey('enter')
.click(modalDialog.find('button[aria-label="blobpats"]'))
.expect(composeInput.value).eql(':blobpats: ')
await sleep(1000)
await t
.click(emojiButton)
await sleep(1000)
await t
.expect(emojiSearchInput.value).eql('')
.typeText(emojiSearchInput, 'blobpeek')
await sleep(1000)
await t
.pressKey('enter')
.click(modalDialog.find('button[aria-label="blobpeek"]'))
.expect(composeInput.value).eql(':blobpeek: :blobpats: ')
})