Use aria descriptions instead of labels for TextWithTooltip (#10952)
* Use aria descriptions instead of labels for TextWithTooltip to prevent clobbering the reading of the content * Update snapshot * Fix snapshots * Iterate * Update snapshots * delint
This commit is contained in:
parent
f4a265b2c7
commit
f52fab39fc
23 changed files with 78 additions and 7 deletions
|
@ -36,6 +36,11 @@ import defaultDispatcher from "../../../../../src/dispatcher/dispatcher";
|
|||
import { Action } from "../../../../../src/dispatcher/actions";
|
||||
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
|
||||
|
||||
// Fake random strings to give a predictable snapshot for IDs
|
||||
jest.mock("matrix-js-sdk/src/randomstring", () => ({
|
||||
randomString: () => "abdefghi",
|
||||
}));
|
||||
|
||||
describe("<PollHistory />", () => {
|
||||
// 14.03.2022 16:15
|
||||
const now = 1647270879403;
|
||||
|
|
|
@ -21,6 +21,11 @@ import { MatrixEvent } from "matrix-js-sdk/src/matrix";
|
|||
import { PollListItem } from "../../../../../src/components/views/polls/pollHistory/PollListItem";
|
||||
import { makePollStartEvent, mockIntlDateTimeFormat, unmockIntlDateTimeFormat } from "../../../../test-utils";
|
||||
|
||||
// Fake random strings to give a predictable snapshot for IDs
|
||||
jest.mock("matrix-js-sdk/src/randomstring", () => ({
|
||||
randomString: () => "abdefghi",
|
||||
}));
|
||||
|
||||
describe("<PollListItem />", () => {
|
||||
const event = makePollStartEvent("Question?", "@me:domain.org");
|
||||
event.getContent().origin;
|
||||
|
|
|
@ -32,6 +32,11 @@ import {
|
|||
unmockIntlDateTimeFormat,
|
||||
} from "../../../../test-utils";
|
||||
|
||||
// Fake random strings to give a predictable snapshot for IDs
|
||||
jest.mock("matrix-js-sdk/src/randomstring", () => ({
|
||||
randomString: () => "abdefghi",
|
||||
}));
|
||||
|
||||
describe("<PollListItemEnded />", () => {
|
||||
const userId = "@alice:domain.org";
|
||||
const roomId = "!room:domain.org";
|
||||
|
|
|
@ -79,6 +79,7 @@ exports[`<PollHistory /> renders a list of active polls when there are polls in
|
|||
data-testid="pollListItem-$2"
|
||||
>
|
||||
<div
|
||||
aria-describedby="mx_TooltipTarget_abdefghi"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
|
@ -103,6 +104,7 @@ exports[`<PollHistory /> renders a list of active polls when there are polls in
|
|||
data-testid="pollListItem-$1"
|
||||
>
|
||||
<div
|
||||
aria-describedby="mx_TooltipTarget_abdefghi"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -7,6 +7,7 @@ exports[`<PollListItem /> renders a poll 1`] = `
|
|||
data-testid="pollListItem-$mypoll"
|
||||
>
|
||||
<div
|
||||
aria-describedby="mx_TooltipTarget_abdefghi"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -7,6 +7,7 @@ exports[`<PollListItemEnded /> renders a poll with no responses 1`] = `
|
|||
data-testid="pollListItem-1"
|
||||
>
|
||||
<div
|
||||
aria-describedby="mx_TooltipTarget_abdefghi"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue