forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ISelectionProvider and ISelectionItemProvider (microsoft#14019
) Adds support for ISelectionProvider interface Adds support for ISelectionItemProvider interface Adds support for accessibilityState:selected Adjusts AccessibilityState native type on Windows to be std::optional instead of bool Adjusts AccessibilityState native type on Windows to include multiselectable and required fields of type std::optional Adds multiselectable and required fields to AccessibilityState type in JS with type boolean | undefined Adds support for aria-multiselectable and aria-required. Adds support for the following accessibilityActions: addToSelection, removeFromSelection, select Fixes crash in AccessibilityInsights.
- Loading branch information
1 parent
0f9d266
commit d429f4f
Showing
28 changed files
with
49,658 additions
and
32,853 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-a7e4e9a7-38af-4609-a0a4-152046e6e53b.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Implement ISelectionProvider and ISelectionItemProvider", | ||
"packageName": "react-native-windows", | ||
"email": "34109996+chiaramooney@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
packages/e2e-test-app-fabric/test/AccessibilityTest.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* @format | ||
*/ | ||
|
||
import {dumpVisualTree} from '@react-native-windows/automation-commands'; | ||
import {goToApiExample} from './RNTesterNavigation'; | ||
import {app} from '@react-native-windows/automation'; | ||
import {verifyNoErrorLogs} from './Helpers'; | ||
|
||
beforeAll(async () => { | ||
// If window is partially offscreen, tests will fail to click on certain elements | ||
await app.setWindowPosition(0, 0); | ||
await app.setWindowSize(1000, 1250); | ||
await goToApiExample('Accessibility Windows'); | ||
}); | ||
|
||
afterEach(async () => { | ||
await verifyNoErrorLogs(); | ||
}); | ||
|
||
const searchBox = async (input: string) => { | ||
const searchBox = await app.findElementByTestID('example_search'); | ||
await app.waitUntil( | ||
async () => { | ||
await searchBox.setValue(input); | ||
return (await searchBox.getText()) === input; | ||
}, | ||
{ | ||
interval: 1500, | ||
timeout: 5000, | ||
timeoutMsg: `Unable to enter correct search text into test searchbox.`, | ||
}, | ||
); | ||
}; | ||
|
||
describe('Accessibility Tests', () => { | ||
test('Elements can set accessibilityState:selected to false', async () => { | ||
await searchBox('Sta'); | ||
const component = await app.findElementByTestID('Selectable item 1'); | ||
await component.waitForDisplayed({timeout: 5000}); | ||
const dump = await dumpVisualTree('Selectable item 1'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Elements can set accessibilityState:selected to true', async () => { | ||
await searchBox('Sta'); | ||
const component = await app.findElementByTestID('Selectable item 1'); | ||
await component.waitForDisplayed({timeout: 5000}); | ||
await component.click(); | ||
const dump = await dumpVisualTree('Selectable item 1'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Selectable items must have a Selection Container. Elements can set accessibilityState:multiselectable and accessibilityState:required to true', async () => { | ||
await searchBox('Sta'); | ||
const componentsTab = await app.findElementByTestID('selection-container'); | ||
await componentsTab.waitForDisplayed({timeout: 5000}); | ||
const dump = await dumpVisualTree('selection-container'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.