mirror of
https://github.com/nolanlawson/pinafore
synced 2024-12-11 17:59:20 +01:00
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.
|
// just a duplicate link in the focus order.
|
||||||
$disableTapOnStatus ? '0' : '-1'
|
$disableTapOnStatus ? '0' : '-1'
|
||||||
),
|
),
|
||||||
createdAtLabel: ({ formattedDate }) => (
|
createdAtLabel: ({ shortInlineFormattedDate }) => (
|
||||||
formatIntl('intl.clickToShowThread', { time: formattedDate })
|
formatIntl('intl.clickToShowThread', { time: shortInlineFormattedDate })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { loginAsFoobar } from '../roles'
|
|||||||
import {
|
import {
|
||||||
generalSettingsButton,
|
generalSettingsButton,
|
||||||
getNthShowOrHideButton,
|
getNthShowOrHideButton,
|
||||||
getNthStatus, homeNavButton,
|
getNthStatus, getNthStatusRelativeDateTime, homeNavButton,
|
||||||
notificationsNavButton,
|
notificationsNavButton,
|
||||||
scrollToStatus,
|
scrollToStatus,
|
||||||
settingsNavButton
|
settingsNavButton
|
||||||
@ -21,6 +21,9 @@ test('basic aria-labels for statuses', async t => {
|
|||||||
.expect(getNthStatus(1).getAttribute('aria-label')).match(
|
.expect(getNthStatus(1).getAttribute('aria-label')).match(
|
||||||
/quux, pinned toot 1, .+ ago, @quux, Unlisted, Boosted by admin/i
|
/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))
|
.hover(getNthStatus(1))
|
||||||
.expect(getNthStatus(2).getAttribute('aria-label')).match(
|
.expect(getNthStatus(2).getAttribute('aria-label')).match(
|
||||||
/admin, @foobar notification of unlisted message, .* ago, @admin, Unlisted/i
|
/admin, @foobar notification of unlisted message, .* ago, @admin, Unlisted/i
|
||||||
|
@ -466,6 +466,10 @@ export function getNthStatusRelativeDate (n) {
|
|||||||
return $(`${getNthStatusSelector(n)} .status-relative-date`)
|
return $(`${getNthStatusSelector(n)} .status-relative-date`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getNthStatusRelativeDateTime (n) {
|
||||||
|
return $(`${getNthStatusSelector(n)} .status-relative-date time`)
|
||||||
|
}
|
||||||
|
|
||||||
export function getNthStatusMediaImg (n) {
|
export function getNthStatusMediaImg (n) {
|
||||||
return $(`${getNthStatusSelector(n)} .status-media img`)
|
return $(`${getNthStatusSelector(n)} .status-media img`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user