2019-03-24 23:08:34 +01:00
|
|
|
import {
|
|
|
|
composeButton,
|
|
|
|
composeModalPostPrivacyButton,
|
|
|
|
getNthPostPrivacyOptionInDialog,
|
|
|
|
postPrivacyButton, postPrivacyDialogButtonUnlisted,
|
|
|
|
scrollToStatus,
|
|
|
|
sleep
|
|
|
|
} from '../utils'
|
2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-03-03 22:23:26 +01:00
|
|
|
|
2018-03-07 06:32:51 +01:00
|
|
|
fixture`014-compose-post-privacy.js`
|
2018-03-03 22:23:26 +01:00
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('Changes post privacy', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
2019-10-07 16:15:12 +02:00
|
|
|
await sleep(2000)
|
2018-05-26 22:51:41 +02:00
|
|
|
await t
|
2018-03-03 22:23:26 +01:00
|
|
|
.expect(postPrivacyButton.getAttribute('aria-label')).eql('Adjust privacy (currently Public)')
|
|
|
|
.click(postPrivacyButton)
|
2019-10-07 16:15:12 +02:00
|
|
|
.expect(getNthPostPrivacyOptionInDialog(2).exists).ok({ timeout: 30000 })
|
2018-04-08 22:42:31 +02:00
|
|
|
.click(getNthPostPrivacyOptionInDialog(2))
|
2018-03-03 22:23:26 +01:00
|
|
|
.expect(postPrivacyButton.getAttribute('aria-label')).eql('Adjust privacy (currently Unlisted)')
|
|
|
|
.click(postPrivacyButton)
|
2019-10-07 16:15:12 +02:00
|
|
|
.expect(getNthPostPrivacyOptionInDialog(1).exists).ok({ timeout: 30000 })
|
2018-04-08 22:42:31 +02:00
|
|
|
.click(getNthPostPrivacyOptionInDialog(1))
|
2018-03-03 22:23:26 +01:00
|
|
|
.expect(postPrivacyButton.getAttribute('aria-label')).eql('Adjust privacy (currently Public)')
|
|
|
|
})
|
2019-03-24 23:08:34 +01:00
|
|
|
|
|
|
|
test('can use privacy dialog within compose dialog', async t => {
|
|
|
|
await loginAsFoobar(t)
|
|
|
|
await scrollToStatus(t, 16)
|
2020-11-29 23:13:27 +01:00
|
|
|
await t.expect(composeButton.getAttribute('aria-label')).eql('Compose toot')
|
2019-03-24 23:08:34 +01:00
|
|
|
await sleep(2000)
|
|
|
|
await t.click(composeButton)
|
|
|
|
.click(composeModalPostPrivacyButton)
|
|
|
|
.click(postPrivacyDialogButtonUnlisted)
|
|
|
|
.expect(composeModalPostPrivacyButton.getAttribute('aria-label')).eql('Adjust privacy (currently Unlisted)')
|
|
|
|
})
|