1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-11 09:45:24 +01:00
Pinafore-Web-Client-Frontend/tests/spec/135-bookmarks.js
2020-08-25 23:47:20 -07:00

26 lines
825 B
JavaScript

import {
communityNavButton, getNthStatus,
getNthStatusOptionsButton, homeNavButton
} from '../utils'
import { loginAsFoobar } from '../roles'
import { Selector as $ } from 'testcafe'
import { postAs } from '../serverActions'
fixture`135-bookmarks.js`
.page`http://localhost:4002`
test('Can open a report UI from a status', async t => {
await postAs('admin', 'hey bookmark this')
await loginAsFoobar(t)
await t
.hover(getNthStatus(1))
.click(getNthStatusOptionsButton(1))
.click($('.modal-dialog button').withText('Bookmark'))
.click(communityNavButton)
.click($('a').withText('Bookmarks'))
.expect(getNthStatus(1).innerText).contains('hey bookmark this')
.click(homeNavButton)
.click(getNthStatusOptionsButton(1))
.click($('.modal-dialog button').withText('Unbookmark'))
})