forked from cybrespace/pinafore
		
	
							parent
							
								
									c1f6c1582d
								
							
						
					
					
						commit
						74ab056f18
					
				
					 2 changed files with 35 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -203,12 +203,12 @@
 | 
			
		|||
        goto(`/statuses/${originalStatusId}`)
 | 
			
		||||
      },
 | 
			
		||||
      openAuthorProfile () {
 | 
			
		||||
        let { originalAccountId } = this.get()
 | 
			
		||||
        goto(`/accounts/${originalAccountId}`)
 | 
			
		||||
        let { accountForShortcut } = this.get()
 | 
			
		||||
        goto(`/accounts/${accountForShortcut.id}`)
 | 
			
		||||
      },
 | 
			
		||||
      async mentionAuthor () {
 | 
			
		||||
        let { originalAccount } = this.get()
 | 
			
		||||
        await composeNewStatusMentioning(originalAccount)
 | 
			
		||||
        let { accountForShortcut } = this.get()
 | 
			
		||||
        await composeNewStatusMentioning(accountForShortcut)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    computed: {
 | 
			
		||||
| 
						 | 
				
			
			@ -222,6 +222,7 @@
 | 
			
		|||
      accountId: ({ account }) => account.id,
 | 
			
		||||
      originalAccount: ({ originalStatus }) => originalStatus.account,
 | 
			
		||||
      originalAccountId: ({ originalAccount }) => originalAccount.id,
 | 
			
		||||
      accountForShortcut: ({ originalAccount, notification }) => notification ? notification.account : originalAccount,
 | 
			
		||||
      visibility: ({ originalStatus }) => originalStatus.visibility,
 | 
			
		||||
      plainTextContent: ({ content }) => htmlToPlainText(content),
 | 
			
		||||
      plainTextContentLength: ({ plainTextContent }) => measureText(plainTextContent),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,3 +56,33 @@ test('Shortcut m toggles mention in a follow notification', async t => {
 | 
			
		|||
    .click(closeDialogButton)
 | 
			
		||||
    .expect(modalDialog.exists).notOk()
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
test('Shortcut p refers to booster in a boost notification', async t => {
 | 
			
		||||
  let idx = 1 // "@admin boosted your status"
 | 
			
		||||
  await loginAsFoobar(t)
 | 
			
		||||
  await t
 | 
			
		||||
    .expect(getUrl()).eql('http://localhost:4002/')
 | 
			
		||||
    .click(notificationsNavButton)
 | 
			
		||||
    .expect(getUrl()).contains('/notifications')
 | 
			
		||||
    .expect(getNthStatus(0).exists).ok({ timeout: 30000 })
 | 
			
		||||
    .pressKey('j '.repeat(idx + 1))
 | 
			
		||||
    .expect(getNthStatus(idx).hasClass('status-active')).ok()
 | 
			
		||||
    .pressKey('p')
 | 
			
		||||
    .expect(getUrl()).contains('/accounts/1')
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
test('Shortcut m refers to favoriter in a favorite notification', async t => {
 | 
			
		||||
  let idx = 0 // "@admin favorited your status"
 | 
			
		||||
  await loginAsFoobar(t)
 | 
			
		||||
  await t
 | 
			
		||||
    .expect(getUrl()).eql('http://localhost:4002/')
 | 
			
		||||
    .click(notificationsNavButton)
 | 
			
		||||
    .expect(getUrl()).contains('/notifications')
 | 
			
		||||
    .expect(getNthStatus(0).exists).ok({ timeout: 30000 })
 | 
			
		||||
    .pressKey('j '.repeat(idx + 1))
 | 
			
		||||
    .expect(getNthStatus(idx).hasClass('status-active')).ok()
 | 
			
		||||
    .pressKey('m')
 | 
			
		||||
    .expect(composeModalInput.value).eql('@admin ')
 | 
			
		||||
    .click(closeDialogButton)
 | 
			
		||||
    .expect(modalDialog.exists).notOk()
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue