fix: fix aria-labels on relative timestamps (#2028)
This commit is contained in:
parent
d0c9be0c09
commit
c815292b0b
|
@ -41,8 +41,8 @@
|
|||
// just a duplicate link in the focus order.
|
||||
$disableTapOnStatus ? '0' : '-1'
|
||||
),
|
||||
createdAtLabel: ({ formattedDate }) => (
|
||||
formatIntl('intl.clickToShowThread', { time: formattedDate })
|
||||
createdAtLabel: ({ shortInlineFormattedDate }) => (
|
||||
formatIntl('intl.clickToShowThread', { time: shortInlineFormattedDate })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { loginAsFoobar } from '../roles'
|
|||
import {
|
||||
generalSettingsButton,
|
||||
getNthShowOrHideButton,
|
||||
getNthStatus, homeNavButton,
|
||||
getNthStatus, getNthStatusRelativeDateTime, homeNavButton,
|
||||
notificationsNavButton,
|
||||
scrollToStatus,
|
||||
settingsNavButton
|
||||
|
@ -21,6 +21,9 @@ test('basic aria-labels for statuses', async t => {
|
|||
.expect(getNthStatus(1).getAttribute('aria-label')).match(
|
||||
/quux, pinned toot 1, .+ ago, @quux, Unlisted, Boosted by admin/i
|
||||
)
|
||||
.expect(getNthStatusRelativeDateTime(1).getAttribute('aria-label')).match(
|
||||
/.* ago - click to show thread/i
|
||||
)
|
||||
.hover(getNthStatus(1))
|
||||
.expect(getNthStatus(2).getAttribute('aria-label')).match(
|
||||
/admin, @foobar notification of unlisted message, .* ago, @admin, Unlisted/i
|
||||
|
|
|
@ -466,6 +466,10 @@ export function getNthStatusRelativeDate (n) {
|
|||
return $(`${getNthStatusSelector(n)} .status-relative-date`)
|
||||
}
|
||||
|
||||
export function getNthStatusRelativeDateTime (n) {
|
||||
return $(`${getNthStatusSelector(n)} .status-relative-date time`)
|
||||
}
|
||||
|
||||
export function getNthStatusMediaImg (n) {
|
||||
return $(`${getNthStatusSelector(n)} .status-media img`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue