It would be great if toHaveAccessibleName() would work as toHaveText() and accept an array of expected accessible names, not only a single string or regular expression. In other words, expected: string | RegExp should be changed to expected: string | RegExp | (string | RegExp)[].
Example
With an Excel-like table where the columns are named A, B, ..., and the rows are named 1, 2, ..., asserting the entire table at once would look something like that:
🚀 Feature Request
It would be great if
toHaveAccessibleName()
would work astoHaveText()
and accept an array of expected accessible names, not only a single string or regular expression. In other words,expected: string | RegExp
should be changed toexpected: string | RegExp | (string | RegExp)[]
.Example
With an Excel-like table where the columns are named A, B, ..., and the rows are named 1, 2, ..., asserting the entire table at once would look something like that:
Motivation
To assert the entire table with the current version of
toHaveAccessibleName()
, I have to write more lines that make the test harder to read:Furthermore, I think it would align nicely with existing assertions that have that capability, for example,
toHaveText()
.