pinafore/tests/spec/017-compose-reply.js

37 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-03-09 17:45:12 +01:00
import {
2018-03-30 10:06:17 +02:00
composeInput,
getNthComposeReplyInput, getNthReplyButton,
getNthStatus, getUrl, goBack, homeNavButton, notificationsNavButton
2018-03-09 17:45:12 +01:00
} from '../utils'
import { foobarRole } from '../roles'
fixture`017-compose-reply.js`
.page`http://localhost:4002`
test('account handle populated correctly for replies', async t => {
await t.useRole(foobarRole)
.click(getNthReplyButton(0))
2018-03-30 10:06:17 +02:00
.expect(getNthComposeReplyInput(0).value).eql('@quux ')
.typeText(getNthComposeReplyInput(0), 'hello quux', {paste: true})
.expect(getNthComposeReplyInput(0).value).eql('@quux hello quux')
.click(notificationsNavButton)
.expect(getUrl()).contains('/notifications')
.click(homeNavButton)
.expect(getUrl()).notContains('/notifications')
.expect(getNthComposeReplyInput(0).value).eql('@quux hello quux')
2018-03-09 17:45:12 +01:00
.expect(composeInput.value).eql('')
2018-03-30 10:06:17 +02:00
.hover(getNthStatus(2))
2018-03-09 17:45:12 +01:00
.hover(getNthStatus(4))
.click(getNthReplyButton(4))
2018-03-30 10:06:17 +02:00
.expect(getNthComposeReplyInput(4).value).eql('')
2018-03-09 17:45:12 +01:00
})
2018-03-10 07:31:26 +01:00
test('replying to posts with mentions', async t => {
2018-03-09 17:45:12 +01:00
await t.useRole(foobarRole)
.click(getNthReplyButton(1))
2018-03-30 10:06:17 +02:00
.expect(getNthComposeReplyInput(1).value).eql('@admin ')
2018-03-09 17:45:12 +01:00
.navigateTo('/accounts/4')
.click(getNthReplyButton(0))
2018-03-30 10:06:17 +02:00
.expect(getNthComposeReplyInput(0).value).eql('@ExternalLinks @admin @quux ')
2018-03-09 17:45:12 +01:00
})