feat: improve AT-SPI labeling

This commit is contained in:
Zoe
2026-09-19 18:19:00 -05:00
parent e73af2bcf9
commit 9d2938a643
3 changed files with 30 additions and 8 deletions
+12
View File
@@ -15,6 +15,18 @@ class AccessibilityTests(unittest.TestCase):
self.saved = {"observationId": "abc", "size": [800, 600], "targets": [self.target]}
self.current = {"targets": [self.target]}
def test_badges_stay_in_their_menu_rows(self):
for y in (31, 59, 87, 223):
left, top = accessibility.badge_position([0, y, 166, 27], 22, 18, 1280, 800)
self.assertGreaterEqual(left, 0)
self.assertGreaterEqual(top, y)
self.assertLessEqual(top + 18, y + 27)
def test_badge_clamped_to_screen(self):
left, top = accessibility.badge_position([1275, 795, 5, 5], 22, 18, 1280, 800)
self.assertLessEqual(left + 22, 1280)
self.assertLessEqual(top + 18, 800)
def test_center(self):
self.assertEqual(accessibility.resolve_target(self.saved, self.current, "abc", "1", 800, 600), (60, 40))