Skip to content

Commit 66655af

Browse files
Copilotanupriya13
andcommitted
Apply formatting and linting fixes to Pressable test file
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
1 parent 39f2df7 commit 66655af

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

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

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ describe('Pressable Tests', () => {
113113
const dump = await dumpVisualTree('pressable_feedback_events_button');
114114
expect(dump).toMatchSnapshot();
115115
await component.moveTo();
116-
const console = await app.findElementByTestID(
116+
const consoleElement = await app.findElementByTestID(
117117
'pressable_feedback_events_console',
118118
);
119-
await console.moveTo();
119+
await consoleElement.moveTo();
120120
const dump2 = await dumpVisualTree('pressable_feedback_events_console');
121121
expect(dump2).toMatchSnapshot();
122122
await app.waitUntil(
@@ -282,17 +282,17 @@ describe('Pressable Tests', () => {
282282
'pressable_feedback_events_button',
283283
);
284284
await component.waitForDisplayed({timeout: 20000});
285-
285+
286286
// Test that long press functionality is available by capturing events
287287
await component.click();
288288
await app.pause(1000); // Allow time for events to be processed
289-
290-
const console = await app.findElementByTestID(
289+
290+
const consoleElement = await app.findElementByTestID(
291291
'pressable_feedback_events_console',
292292
);
293293
const dump = await dumpVisualTree('pressable_feedback_events_console');
294294
expect(dump).toMatchSnapshot();
295-
295+
296296
await app.waitUntil(
297297
async () => {
298298
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
@@ -322,17 +322,17 @@ describe('Pressable Tests', () => {
322322
'pressable_delay_events_button',
323323
);
324324
await component.waitForDisplayed({timeout: 20000});
325-
325+
326326
// Test delayLongPress behavior by capturing delayed event responses
327327
await component.click();
328328
await app.pause(1000); // Allow time for delayed events to be processed
329-
330-
const console = await app.findElementByTestID(
329+
330+
const consoleElement = await app.findElementByTestID(
331331
'pressable_delay_events_console',
332332
);
333333
const dump = await dumpVisualTree('pressable_delay_events_console');
334334
expect(dump).toMatchSnapshot();
335-
335+
336336
await app.waitUntil(
337337
async () => {
338338
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
@@ -362,13 +362,13 @@ describe('Pressable Tests', () => {
362362
'pressable_hit_slop_button',
363363
);
364364
await component.waitForDisplayed({timeout: 20000});
365-
365+
366366
// Click on the component to test hitSlop interaction
367367
await component.click();
368-
368+
369369
const dump = await dumpVisualTree('pressable_hit_slop');
370370
expect(dump).toMatchSnapshot();
371-
371+
372372
await app.waitUntil(
373373
async () => {
374374
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
@@ -394,19 +394,23 @@ describe('Pressable Tests', () => {
394394
timeoutMsg: `Unable to enter correct search text into test searchbox.`,
395395
},
396396
);
397-
397+
398398
// Test disabled=true styling
399-
const disabledComponent = await app.findElementByTestID('pressable_disabled_true');
399+
const disabledComponent = await app.findElementByTestID(
400+
'pressable_disabled_true',
401+
);
400402
await disabledComponent.waitForDisplayed({timeout: 20000});
401403
const disabledDump = await dumpVisualTree('pressable_disabled_true');
402404
expect(disabledDump).toMatchSnapshot();
403-
405+
404406
// Test disabled=false styling with press state
405-
const enabledComponent = await app.findElementByTestID('pressable_disabled_false');
407+
const enabledComponent = await app.findElementByTestID(
408+
'pressable_disabled_false',
409+
);
406410
await enabledComponent.waitForDisplayed({timeout: 20000});
407411
const enabledDump = await dumpVisualTree('pressable_disabled_false');
408412
expect(enabledDump).toMatchSnapshot();
409-
413+
410414
await app.waitUntil(
411415
async () => {
412416
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
@@ -432,13 +436,13 @@ describe('Pressable Tests', () => {
432436
timeoutMsg: `Unable to enter correct search text into test searchbox.`,
433437
},
434438
);
435-
439+
436440
// Test pressable with different content based on press state
437441
const component = await app.findElementByTestID('one_press_me_button');
438442
await component.waitForDisplayed({timeout: 20000});
439443
const initialDump = await dumpVisualTree('one_press_me_button');
440444
expect(initialDump).toMatchSnapshot();
441-
445+
442446
await app.waitUntil(
443447
async () => {
444448
await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']);
@@ -454,7 +458,7 @@ describe('Pressable Tests', () => {
454458
// TODO: Add fast refresh tests once test components are available
455459
// These tests would require components with buttons/toggles to change properties at runtime:
456460
// - Pressable should update border styling upon fast refresh
457-
// - Pressable should update children upon fast refresh
461+
// - Pressable should update children upon fast refresh
458462
// - Pressable should update disabled styling upon fast refresh
459463
test('Pressables can have advanced borders', async () => {
460464
const component = await app.findElementByTestID(

0 commit comments

Comments
 (0)