From b014778761dd8e53408082d7092e7f90ec32505d Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 19 Jan 2019 16:04:06 -0800 Subject: [PATCH] fix: fix keyboard shortcuts in notifications (#903) fixes #894 --- .../_components/status/Notification.html | 2 +- .../timeline/NotificationVirtualListItem.html | 1 + tests/spec/025-shortcuts-status.js | 22 +++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/routes/_components/status/Notification.html b/src/routes/_components/status/Notification.html index 0864c66..be6e3eb 100644 --- a/src/routes/_components/status/Notification.html +++ b/src/routes/_components/status/Notification.html @@ -1,6 +1,6 @@ {#if status} {:else}
{ .pressKey('f') .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') +})