Skip to content

Commit c289d5d

Browse files
[0.77] [Fabric] Add Support for ITextProvider, ITextProvider2, and ITextRangeProvider (#14422)
* [Fabric] Add Support for ITextProvider, ITextProvider2, and ITextRangeProvider (#14332) * Partial Implementation * Add More Implementation * More Implementation * More Implementation * Add Support for Bounding Rectangles * Complete Initial Implementation * Change files * Code Cleanup * Code Cleanup * Update Snapshots + Code Cleanup * Update Snapshots * Address Feedback * Address Feedback * Update Snapshots * Fix Tests --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com> * Change Files * Update Snapshots --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com>
1 parent f11ceab commit c289d5d

27 files changed

+1105
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "ITextProvider Implementation",
4+
"packageName": "react-native-windows",
5+
"email": "34109996+chiaramooney@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/e2e-test-app-fabric/test/ButtonComponentTest.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ const searchBox = async (input: string) => {
2727
await app.waitUntil(
2828
async () => {
2929
await searchBox.setValue(input);
30-
return (await searchBox.getText()) === input;
30+
if (input === '') {
31+
return (await searchBox.getText()) === 'Search...';
32+
} else {
33+
return (await searchBox.getText()) === input;
34+
}
3135
},
3236
{
3337
interval: 1500,

packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Pressable Tests', () => {
4545
await app.waitUntil(
4646
async () => {
4747
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
48-
return (await searchBox.getText()) === '';
48+
return (await searchBox.getText()) === 'Search...';
4949
},
5050
{
5151
interval: 1500,
@@ -84,7 +84,7 @@ describe('Pressable Tests', () => {
8484
await app.waitUntil(
8585
async () => {
8686
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
87-
return (await searchBox.getText()) === '';
87+
return (await searchBox.getText()) === 'Search...';
8888
},
8989
{
9090
interval: 1500,
@@ -118,7 +118,7 @@ describe('Pressable Tests', () => {
118118
await app.waitUntil(
119119
async () => {
120120
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
121-
return (await searchBox.getText()) === '';
121+
return (await searchBox.getText()) === 'Search...';
122122
},
123123
{
124124
interval: 1500,
@@ -152,7 +152,7 @@ describe('Pressable Tests', () => {
152152
await app.waitUntil(
153153
async () => {
154154
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
155-
return (await searchBox.getText()) === '';
155+
return (await searchBox.getText()) === 'Search...';
156156
},
157157
{
158158
interval: 1500,
@@ -181,7 +181,7 @@ describe('Pressable Tests', () => {
181181
await app.waitUntil(
182182
async () => {
183183
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
184-
return (await searchBox.getText()) === '';
184+
return (await searchBox.getText()) === 'Search...';
185185
},
186186
{
187187
interval: 1500,
@@ -210,7 +210,7 @@ describe('Pressable Tests', () => {
210210
await app.waitUntil(
211211
async () => {
212212
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
213-
return (await searchBox.getText()) === '';
213+
return (await searchBox.getText()) === 'Search...';
214214
},
215215
{
216216
interval: 1500,

packages/e2e-test-app-fabric/test/__snapshots__/AccessibilityTest.test.ts.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ exports[`Accessibility Tests Components can store range data by setting the min,
1717
"ControlType": 50020,
1818
"LocalizedControlType": "text",
1919
"Name": "The View's (accessibilityRole == adjustable, ie. Slider) properties should be the following according to UIA: Min- 5Max- 125Now- 10",
20+
"TextRangePattern.GetText": "The View's (accessibilityRole == adjustable, ie. Slider) properties should be the following according to UIA: Min- 5Max- 125Now- 10",
2021
},
2122
],
2223
},
@@ -73,6 +74,7 @@ exports[`Accessibility Tests Components can store value data by setting the text
7374
"ControlType": 50020,
7475
"LocalizedControlType": "text",
7576
"Name": "The View's properties should be the following according to UIA: Text- testText",
77+
"TextRangePattern.GetText": "The View's properties should be the following according to UIA: Text- testText",
7678
},
7779
],
7880
},
@@ -129,6 +131,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to fal
129131
"ControlType": 50020,
130132
"LocalizedControlType": "text",
131133
"Name": "Unselected",
134+
"TextRangePattern.GetText": "Unselected",
132135
},
133136
],
134137
},
@@ -187,6 +190,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to tru
187190
"ControlType": 50020,
188191
"LocalizedControlType": "text",
189192
"Name": "Selected",
193+
"TextRangePattern.GetText": "Selected",
190194
},
191195
],
192196
},
@@ -252,6 +256,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
252256
"ControlType": 50020,
253257
"LocalizedControlType": "text",
254258
"Name": "Unselected",
259+
"TextRangePattern.GetText": "Unselected",
255260
},
256261
],
257262
},
@@ -267,6 +272,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
267272
"ControlType": 50020,
268273
"LocalizedControlType": "text",
269274
"Name": "Unselected",
275+
"TextRangePattern.GetText": "Unselected",
270276
},
271277
],
272278
},
@@ -282,6 +288,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
282288
"ControlType": 50020,
283289
"LocalizedControlType": "text",
284290
"Name": "Unselected",
291+
"TextRangePattern.GetText": "Unselected",
285292
},
286293
],
287294
},

packages/e2e-test-app-fabric/test/__snapshots__/ButtonComponentTest.test.ts.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ exports[`Button Tests Buttons can be disabled 1`] = `
1515
"IsEnabled": false,
1616
"LocalizedControlType": "text",
1717
"Name": "Submit Application",
18+
"TextRangePattern.GetText": "Submit Application",
1819
},
1920
],
2021
},
@@ -162,6 +163,7 @@ exports[`Button Tests Buttons can have accessibility labels 1`] = `
162163
"ControlType": 50020,
163164
"LocalizedControlType": "text",
164165
"Name": "Submit Application",
166+
"TextRangePattern.GetText": "Submit Application",
165167
},
166168
],
167169
},
@@ -310,6 +312,7 @@ exports[`Button Tests Buttons can have accessibility props 1`] = `
310312
"ControlType": 50020,
311313
"LocalizedControlType": "text",
312314
"Name": "Submit Application",
315+
"TextRangePattern.GetText": "Submit Application",
313316
},
314317
],
315318
},
@@ -440,6 +443,7 @@ exports[`Button Tests Buttons can have accessibility states 1`] = `
440443
"IsEnabled": false,
441444
"LocalizedControlType": "text",
442445
"Name": "Submit Application",
446+
"TextRangePattern.GetText": "Submit Application",
443447
},
444448
],
445449
},
@@ -587,6 +591,7 @@ exports[`Button Tests Buttons can have custom colors 1`] = `
587591
"ControlType": 50020,
588592
"LocalizedControlType": "text",
589593
"Name": "Cancel Application",
594+
"TextRangePattern.GetText": "Cancel Application",
590595
},
591596
],
592597
},
@@ -849,6 +854,7 @@ exports[`Button Tests Buttons can have custom focusable and accessible props 2`]
849854
"ControlType": 50020,
850855
"LocalizedControlType": "text",
851856
"Name": "Button with focusable=false",
857+
"TextRangePattern.GetText": "Button with focusable=false",
852858
},
853859
],
854860
},
@@ -1098,6 +1104,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = `
10981104
"ControlType": 50020,
10991105
"LocalizedControlType": "text",
11001106
"Name": "Cancel",
1107+
"TextRangePattern.GetText": "Cancel",
11011108
},
11021109
],
11031110
},
@@ -1113,6 +1120,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = `
11131120
"ControlType": 50020,
11141121
"LocalizedControlType": "text",
11151122
"Name": "Submit",
1123+
"TextRangePattern.GetText": "Submit",
11161124
},
11171125
],
11181126
},
@@ -1424,6 +1432,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] =
14241432
"ControlType": 50020,
14251433
"LocalizedControlType": "text",
14261434
"Name": "Cancel",
1435+
"TextRangePattern.GetText": "Cancel",
14271436
},
14281437
],
14291438
},
@@ -1439,6 +1448,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] =
14391448
"ControlType": 50020,
14401449
"LocalizedControlType": "text",
14411450
"Name": "Save For Later",
1451+
"TextRangePattern.GetText": "Save For Later",
14421452
},
14431453
],
14441454
},
@@ -1454,6 +1464,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] =
14541464
"ControlType": 50020,
14551465
"LocalizedControlType": "text",
14561466
"Name": "Submit",
1467+
"TextRangePattern.GetText": "Submit",
14571468
},
14581469
],
14591470
},
@@ -1894,6 +1905,7 @@ exports[`Button Tests Buttons have default styling 1`] = `
18941905
"ControlType": 50020,
18951906
"LocalizedControlType": "text",
18961907
"Name": "Submit Application",
1908+
"TextRangePattern.GetText": "Submit Application",
18971909
},
18981910
],
18991911
},

0 commit comments

Comments
 (0)