aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_upload_controls_hidden.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_upload_controls_hidden.py')
-rw-r--r--packages/meshbay-hub/tests/test_upload_controls_hidden.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/meshbay-hub/tests/test_upload_controls_hidden.py b/packages/meshbay-hub/tests/test_upload_controls_hidden.py
index a61de1f..bdba373 100644
--- a/packages/meshbay-hub/tests/test_upload_controls_hidden.py
+++ b/packages/meshbay-hub/tests/test_upload_controls_hidden.py
@@ -94,13 +94,20 @@ def test_an_icon_only_button_still_says_what_it_is():
The name moved into a tooltip to save toolbar width. A `title` is invisible
to a screen reader on a button with no text, so the label has to be there
as well — otherwise the control is simply unnamed for anyone not reading
- with their eyes.
+ with their eyes. The same goes for the field it opens, which has a
+ placeholder and no visible label.
"""
page = _component(FILES_APP.read_text(encoding="utf-8"), "FilesPanel")
- block = page[page.index("canCreateDir && html`"):]
- block = block[:block.index("</button>")]
- assert "title=" in block and "aria-label=" in block
- assert "group.mkdir" in block
+ opener = page[page.index("canCreateDir && newDirName === null"):]
+ opener = opener[:opener.index("</button>")]
+ assert "title=" in opener and "aria-label=" in opener
+ assert "group.mkdir" in opener
+
+ field = page[page.index("canCreateDir && newDirName !== null"):]
+ field = field[:field.index("</span>")]
+ assert "aria-label=" in field, (
+ "the name field is labelled by a placeholder alone, which a screen "
+ "reader does not announce as a name")
def test_the_chat_composer_hides_its_paperclip():