parent
							
								
									031caec406
								
							
						
					
					
						commit
						b014778761
					
				
					 3 changed files with 22 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{#if status}
 | 
			
		||||
  <Status {index} {length} {timelineType} {timelineValue} {focusSelector}
 | 
			
		||||
          {status} {notification} {active} on:recalculateHeight
 | 
			
		||||
          {status} {notification} {active} {shortcutScope} on:recalculateHeight
 | 
			
		||||
  />
 | 
			
		||||
{:else}
 | 
			
		||||
  <article class="notification-article {active ? 'active' : ''}"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,7 @@
 | 
			
		|||
  timelineType={virtualProps.timelineType}
 | 
			
		||||
  timelineValue={virtualProps.timelineValue}
 | 
			
		||||
  focusSelector={virtualProps.focusSelector}
 | 
			
		||||
  shortcutScope={virtualKey}
 | 
			
		||||
  index={virtualIndex}
 | 
			
		||||
  length={virtualLength}
 | 
			
		||||
  {active}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,9 @@ import {
 | 
			
		|||
  getNthStatusMedia,
 | 
			
		||||
  getNthStatusSensitiveMediaButton,
 | 
			
		||||
  getNthStatusSpoiler,
 | 
			
		||||
  getUrl,
 | 
			
		||||
  scrollToStatus } from '../utils'
 | 
			
		||||
  getUrl, notificationsNavButton,
 | 
			
		||||
  scrollToStatus
 | 
			
		||||
} from '../utils'
 | 
			
		||||
import { homeTimeline } from '../fixtures'
 | 
			
		||||
import { loginAsFoobar } from '../roles'
 | 
			
		||||
import { indexWhere } from '../../src/routes/_utils/arrays'
 | 
			
		||||
| 
						 | 
				
			
			@ -126,3 +127,20 @@ test('Shortcut f toggles favorite status', async t => {
 | 
			
		|||
    .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')
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue