test: add test for shortcut when focus is inside status (#2232)
This commit is contained in:
parent
8792d912bc
commit
53803db5be
|
@ -7,9 +7,17 @@ import {
|
|||
getNthStatusMediaImg,
|
||||
getNthStatusSensitiveMediaButton,
|
||||
getNthStatusSpoiler,
|
||||
getUrl, modalDialog,
|
||||
getUrl,
|
||||
modalDialog,
|
||||
scrollToStatus,
|
||||
isNthStatusActive, getActiveElementRectTop, scrollToTop, isActiveStatusPinned, getFirstModalMedia
|
||||
isNthStatusActive,
|
||||
getActiveElementRectTop,
|
||||
scrollToTop,
|
||||
isActiveStatusPinned,
|
||||
getFirstModalMedia,
|
||||
getNthStatusAccountLink,
|
||||
getNthStatusAccountLinkSelector,
|
||||
focus
|
||||
} from '../utils'
|
||||
import { homeTimeline } from '../fixtures'
|
||||
import { loginAsFoobar } from '../roles'
|
||||
|
@ -216,3 +224,13 @@ test('Shortcut j/k change the active status on pinned statuses', async t => {
|
|||
.expect(isNthStatusActive(1)()).ok()
|
||||
.expect(isActiveStatusPinned()).eql(true)
|
||||
})
|
||||
|
||||
test('Shortcut down makes next status active when focused inside of a status', async t => {
|
||||
await loginAsFoobar(t)
|
||||
await t
|
||||
.expect(getNthStatusAccountLink(1).exists).ok()
|
||||
await focus(getNthStatusAccountLinkSelector(1))()
|
||||
await t
|
||||
.pressKey('down')
|
||||
.expect(isNthStatusActive(2)()).ok()
|
||||
})
|
||||
|
|
|
@ -522,8 +522,12 @@ export function getNthStatusOptionsButton (n) {
|
|||
return $(`${getNthStatusSelector(n)} .status-toolbar button:nth-child(4)`)
|
||||
}
|
||||
|
||||
export function getNthStatusAccountLinkSelector (n) {
|
||||
return `${getNthStatusSelector(n)} .status-author-name`
|
||||
}
|
||||
|
||||
export function getNthStatusAccountLink (n) {
|
||||
return $(`${getNthStatusSelector(n)} .status-author-name`)
|
||||
return $(getNthStatusAccountLinkSelector(n))
|
||||
}
|
||||
|
||||
export function getNthFavoritedLabel (n) {
|
||||
|
|
Loading…
Reference in a new issue