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

View file

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