Skip to content

Commit fdc6d2a

Browse files
acoates-msvmoroz
authored andcommitted
snapshots + lint
1 parent 9c2fb74 commit fdc6d2a

3 files changed

Lines changed: 275 additions & 28 deletions

File tree

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* @format
66
*/
77

8-
import { app } from '@react-native-windows/automation';
9-
import { dumpVisualTree } from '@react-native-windows/automation-commands';
10-
import { goToComponentExample } from './RNTesterNavigation';
11-
import { verifyNoErrorLogs } from './Helpers';
8+
import {app} from '@react-native-windows/automation';
9+
import {dumpVisualTree} from '@react-native-windows/automation-commands';
10+
import {goToComponentExample} from './RNTesterNavigation';
11+
import {verifyNoErrorLogs} from './Helpers';
1212

1313
beforeAll(async () => {
1414
// If window is partially offscreen, tests will fail to click on certain elements
@@ -23,11 +23,10 @@ afterEach(async () => {
2323

2424
async function verifyElementAccessibiltyValue(element: string, value: string) {
2525
const dump = await dumpVisualTree(element);
26-
expect(dump!["Automation Tree"]["ValuePattern.Value"]).toBe(value);
26+
expect(dump!['Automation Tree']['ValuePattern.Value']).toBe(value);
2727
}
2828

2929
describe('Hit Testing', () => {
30-
3130
test('Hit testing child outside the bounds of parents', async () => {
3231
const target = await app.findElementByTestID('visible-overflow-element');
3332

@@ -36,13 +35,13 @@ describe('Hit Testing', () => {
3635

3736
// The webdriverio package computes the offsets from the center point of the target.
3837
// This is within the bounds of the child and the parent, so should hitTest even with overflow:visible
39-
await target.click({ x: -50, y: -50, });
38+
await target.click({x: -50, y: -50});
4039

4140
await verifyElementAccessibiltyValue('visible-overflow-element', 'green');
4241

4342
// The webdriverio package computes the offsets from the center point of the target.
4443
// This is within the bounds of the child, but outside the parents bounds
45-
await target.click({ x: 0, y: 0, });
44+
await target.click({x: 0, y: 0});
4645

4746
// View should still be red, since the click should hit the pressable
4847
await verifyElementAccessibiltyValue('visible-overflow-element', 'red');
@@ -55,15 +54,14 @@ describe('Hit Testing', () => {
5554
await verifyElementAccessibiltyValue('hidden-overflow-element', 'red');
5655

5756
// This is within the bounds of the child and the parent, so should hitTest even with overflow:hidden
58-
await target.click({ x: -50, y: -50, });
57+
await target.click({x: -50, y: -50});
5958

6059
await verifyElementAccessibiltyValue('hidden-overflow-element', 'green');
6160

6261
// This is within the bounds of the child, but shouldn't hit test, since the parent is overflow:hidden
63-
await target.click({ x: 0, y: 0, });
62+
await target.click({x: 0, y: 0});
6463

6564
// View should still be green, since the click shouldn't hit the pressable
6665
await verifyElementAccessibiltyValue('hidden-overflow-element', 'green');
6766
});
68-
6967
});

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

Lines changed: 98 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,87 @@ exports[`Home UIA Tree Dump Glyph UWP 1`] = `
24412441
}
24422442
`;
24432443

2444+
exports[`Home UIA Tree Dump Hit Testing 1`] = `
2445+
{
2446+
"Automation Tree": {
2447+
"AutomationId": "Hit Testing",
2448+
"ControlType": 50026,
2449+
"IsKeyboardFocusable": true,
2450+
"LocalizedControlType": "group",
2451+
"Name": "Hit Testing Test that overflow hidden affect hit testing",
2452+
"__Children": [
2453+
{
2454+
"AutomationId": "",
2455+
"ControlType": 50020,
2456+
"LocalizedControlType": "text",
2457+
"Name": "Hit Testing",
2458+
"TextRangePattern.GetText": "Hit Testing",
2459+
},
2460+
{
2461+
"AutomationId": "",
2462+
"ControlType": 50020,
2463+
"LocalizedControlType": "text",
2464+
"Name": "Test that overflow hidden affect hit testing",
2465+
"TextRangePattern.GetText": "Test that overflow hidden affect hit testing",
2466+
},
2467+
],
2468+
},
2469+
"Component Tree": {
2470+
"Type": "Microsoft.ReactNative.Composition.ViewComponentView",
2471+
"_Props": {
2472+
"AccessibilityLabel": "Hit Testing Test that overflow hidden affect hit testing",
2473+
"TestId": "Hit Testing",
2474+
},
2475+
"__Children": [
2476+
{
2477+
"Type": "Microsoft.ReactNative.Composition.ParagraphComponentView",
2478+
"_Props": {},
2479+
},
2480+
{
2481+
"Type": "Microsoft.ReactNative.Composition.ParagraphComponentView",
2482+
"_Props": {},
2483+
},
2484+
],
2485+
},
2486+
"Visual Tree": {
2487+
"Brush": {
2488+
"Brush Type": "ColorBrush",
2489+
"Color": "rgba(255, 255, 255, 255)",
2490+
},
2491+
"Comment": "Hit Testing",
2492+
"Offset": "0, 0, 0",
2493+
"Size": "966, 77",
2494+
"Visual Type": "SpriteVisual",
2495+
"__Children": [
2496+
{
2497+
"Offset": "16, 16, 0",
2498+
"Size": "85, 25",
2499+
"Visual Type": "SpriteVisual",
2500+
"__Children": [
2501+
{
2502+
"Offset": "0, 0, 0",
2503+
"Size": "85, 25",
2504+
"Visual Type": "SpriteVisual",
2505+
},
2506+
],
2507+
},
2508+
{
2509+
"Offset": "16, 45, 0",
2510+
"Size": "934, 17",
2511+
"Visual Type": "SpriteVisual",
2512+
"__Children": [
2513+
{
2514+
"Offset": "0, 0, 0",
2515+
"Size": "934, 17",
2516+
"Visual Type": "SpriteVisual",
2517+
},
2518+
],
2519+
},
2520+
],
2521+
},
2522+
}
2523+
`;
2524+
24442525
exports[`Home UIA Tree Dump Image 1`] = `
24452526
{
24462527
"Automation Tree": {
@@ -2490,7 +2571,7 @@ exports[`Home UIA Tree Dump Image 1`] = `
24902571
},
24912572
"Comment": "Image",
24922573
"Offset": "0, 0, 0",
2493-
"Size": "966, 77",
2574+
"Size": "966, 78",
24942575
"Visual Type": "SpriteVisual",
24952576
"__Children": [
24962577
{
@@ -3317,12 +3398,12 @@ exports[`Home UIA Tree Dump LegacyLoginTest 1`] = `
33173398
},
33183399
{
33193400
"Offset": "16, 45, 0",
3320-
"Size": "934, 17",
3401+
"Size": "934, 16",
33213402
"Visual Type": "SpriteVisual",
33223403
"__Children": [
33233404
{
33243405
"Offset": "0, 0, 0",
3325-
"Size": "934, 17",
3406+
"Size": "934, 16",
33263407
"Visual Type": "SpriteVisual",
33273408
},
33283409
],
@@ -3398,12 +3479,12 @@ exports[`Home UIA Tree Dump LegacySelectableTextTest 1`] = `
33983479
},
33993480
{
34003481
"Offset": "16, 45, 0",
3401-
"Size": "934, 16",
3482+
"Size": "934, 17",
34023483
"Visual Type": "SpriteVisual",
34033484
"__Children": [
34043485
{
34053486
"Offset": "0, 0, 0",
3406-
"Size": "934, 16",
3487+
"Size": "934, 17",
34073488
"Visual Type": "SpriteVisual",
34083489
},
34093490
],
@@ -3948,7 +4029,7 @@ exports[`Home UIA Tree Dump Moving Light Example 1`] = `
39484029
},
39494030
"Comment": "Moving Light Example",
39504031
"Offset": "0, 0, 0",
3951-
"Size": "966, 78",
4032+
"Size": "966, 77",
39524033
"Visual Type": "SpriteVisual",
39534034
"__Children": [
39544035
{
@@ -4110,7 +4191,7 @@ exports[`Home UIA Tree Dump New App Screen 1`] = `
41104191
},
41114192
"Comment": "New App Screen",
41124193
"Offset": "0, 0, 0",
4113-
"Size": "966, 77",
4194+
"Size": "966, 78",
41144195
"Visual Type": "SpriteVisual",
41154196
"__Children": [
41164197
{
@@ -4937,12 +5018,12 @@ exports[`Home UIA Tree Dump ScrollView 1`] = `
49375018
},
49385019
{
49395020
"Offset": "16, 45, 0",
4940-
"Size": "934, 17",
5021+
"Size": "934, 16",
49415022
"Visual Type": "SpriteVisual",
49425023
"__Children": [
49435024
{
49445025
"Offset": "0, 0, 0",
4945-
"Size": "934, 17",
5026+
"Size": "934, 16",
49465027
"Visual Type": "SpriteVisual",
49475028
},
49485029
],
@@ -5018,12 +5099,12 @@ exports[`Home UIA Tree Dump ScrollViewAnimated 1`] = `
50185099
},
50195100
{
50205101
"Offset": "16, 45, 0",
5021-
"Size": "934, 16",
5102+
"Size": "934, 17",
50225103
"Visual Type": "SpriteVisual",
50235104
"__Children": [
50245105
{
50255106
"Offset": "0, 0, 0",
5026-
"Size": "934, 16",
5107+
"Size": "934, 17",
50275108
"Visual Type": "SpriteVisual",
50285109
},
50295110
],
@@ -5597,7 +5678,7 @@ exports[`Home UIA Tree Dump Text 1`] = `
55975678
},
55985679
"Comment": "Text",
55995680
"Offset": "0, 0, 0",
5600-
"Size": "966, 78",
5681+
"Size": "966, 77",
56015682
"Visual Type": "SpriteVisual",
56025683
"__Children": [
56035684
{
@@ -5678,7 +5759,7 @@ exports[`Home UIA Tree Dump TextInput 1`] = `
56785759
},
56795760
"Comment": "TextInput",
56805761
"Offset": "0, 0, 0",
5681-
"Size": "966, 77",
5762+
"Size": "966, 78",
56825763
"Visual Type": "SpriteVisual",
56835764
"__Children": [
56845765
{
@@ -6169,12 +6250,12 @@ exports[`Home UIA Tree Dump TransparentHitTestExample 1`] = `
61696250
"__Children": [
61706251
{
61716252
"Offset": "16, 16, 0",
6172-
"Size": "214, 25",
6253+
"Size": "214, 24",
61736254
"Visual Type": "SpriteVisual",
61746255
"__Children": [
61756256
{
61766257
"Offset": "0, 0, 0",
6177-
"Size": "214, 25",
6258+
"Size": "214, 24",
61786259
"Visual Type": "SpriteVisual",
61796260
},
61806261
],
@@ -6412,12 +6493,12 @@ exports[`Home UIA Tree Dump View 1`] = `
64126493
"__Children": [
64136494
{
64146495
"Offset": "16, 16, 0",
6415-
"Size": "38, 24",
6496+
"Size": "38, 25",
64166497
"Visual Type": "SpriteVisual",
64176498
"__Children": [
64186499
{
64196500
"Offset": "0, 0, 0",
6420-
"Size": "38, 24",
6501+
"Size": "38, 25",
64216502
"Visual Type": "SpriteVisual",
64226503
},
64236504
],

0 commit comments

Comments
 (0)