parent
031caec406
commit
b014778761
|
@ -1,6 +1,6 @@
|
||||||
{#if status}
|
{#if status}
|
||||||
<Status {index} {length} {timelineType} {timelineValue} {focusSelector}
|
<Status {index} {length} {timelineType} {timelineValue} {focusSelector}
|
||||||
{status} {notification} {active} on:recalculateHeight
|
{status} {notification} {active} {shortcutScope} on:recalculateHeight
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<article class="notification-article {active ? 'active' : ''}"
|
<article class="notification-article {active ? 'active' : ''}"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
timelineType={virtualProps.timelineType}
|
timelineType={virtualProps.timelineType}
|
||||||
timelineValue={virtualProps.timelineValue}
|
timelineValue={virtualProps.timelineValue}
|
||||||
focusSelector={virtualProps.focusSelector}
|
focusSelector={virtualProps.focusSelector}
|
||||||
|
shortcutScope={virtualKey}
|
||||||
index={virtualIndex}
|
index={virtualIndex}
|
||||||
length={virtualLength}
|
length={virtualLength}
|
||||||
{active}
|
{active}
|
||||||
|
|
|
@ -6,8 +6,9 @@ import {
|
||||||
getNthStatusMedia,
|
getNthStatusMedia,
|
||||||
getNthStatusSensitiveMediaButton,
|
getNthStatusSensitiveMediaButton,
|
||||||
getNthStatusSpoiler,
|
getNthStatusSpoiler,
|
||||||
getUrl,
|
getUrl, notificationsNavButton,
|
||||||
scrollToStatus } from '../utils'
|
scrollToStatus
|
||||||
|
} from '../utils'
|
||||||
import { homeTimeline } from '../fixtures'
|
import { homeTimeline } from '../fixtures'
|
||||||
import { loginAsFoobar } from '../roles'
|
import { loginAsFoobar } from '../roles'
|
||||||
import { indexWhere } from '../../src/routes/_utils/arrays'
|
import { indexWhere } from '../../src/routes/_utils/arrays'
|
||||||
|
@ -126,3 +127,20 @@ test('Shortcut f toggles favorite status', async t => {
|
||||||
.pressKey('f')
|
.pressKey('f')
|
||||||
.expect(getNthFavorited(idx)).eql('false')
|
.expect(getNthFavorited(idx)).eql('false')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('Shortcut f toggles favorite status in notification', async t => {
|
||||||
|
let idx = 0
|
||||||
|
await loginAsFoobar(t)
|
||||||
|
await t
|
||||||
|
.expect(getUrl()).eql('http://localhost:4002/')
|
||||||
|
.click(notificationsNavButton)
|
||||||
|
.expect(getUrl()).contains('/notifications')
|
||||||
|
.expect(getNthStatus(idx).exists).ok({ timeout: 30000 })
|
||||||
|
.expect(getNthFavorited(idx)).eql('false')
|
||||||
|
.pressKey('j '.repeat(idx + 1))
|
||||||
|
.expect(getNthStatus(idx).hasClass('status-active')).ok()
|
||||||
|
.pressKey('f')
|
||||||
|
.expect(getNthFavorited(idx)).eql('true')
|
||||||
|
.pressKey('f')
|
||||||
|
.expect(getNthFavorited(idx)).eql('false')
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue