From 45a143a0a65240920201e22cd1796e98becc92cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:09:16 +0000 Subject: [PATCH 1/4] Initial plan for issue From 86f932655def4019968c15a7ef247a88a530b73e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:16:39 +0000 Subject: [PATCH 2/4] Add functional tests for FlatList component Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com> --- .../test/FlatListComponentTest.test.ts | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts b/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts index 727e622c0fd..617752a973a 100644 --- a/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts +++ b/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts @@ -126,4 +126,66 @@ describe('FlatList Tests', () => { const dump = await dumpVisualTree('flatlist-nested'); expect(dump).toMatchSnapshot(); }); + + // Functional tests for fast refresh scenarios + test('FlatList styles should render correctly with multicolumn layout', async () => { + await searchBox('Multi'); + await goToFlatListExample('Multi Column'); + + const component = await app.findElementByTestID('flat_list'); + await component.waitForDisplayed({timeout: 5000}); + const dump = await dumpVisualTree('flat_list'); + expect(dump).toMatchSnapshot(); + }); + + test('FlatList contents should update with search filtering', async () => { + await searchBox('Basic'); + await goToFlatListExample('Basic'); + + // Test filtering content with specific text + await searchBoxBasic('5'); + + const component = await app.findElementByTestID('flatlist-basic'); + await component.waitForDisplayed({timeout: 5000}); + const dump = await dumpVisualTree('flatlist-basic'); + expect(dump).toMatchSnapshot(); + }); + + test('FlatList scrolling should work with inverted list', async () => { + await searchBox('Inverted'); + await goToFlatListExample('Inverted'); + + const component = await app.findElementByTestID('flat_list'); + await component.waitForDisplayed({timeout: 5000}); + const dump = await dumpVisualTree('flat_list'); + expect(dump).toMatchSnapshot(); + }); + + test('FlatList footer should update correctly', async () => { + await searchBox('Basic'); + await goToFlatListExample('Basic'); + + // The basic example includes a footer by default, verify it's rendered + const component = await app.findElementByTestID('flatlist-basic'); + await component.waitForDisplayed({timeout: 5000}); + + // Look for footer content in the visual tree + const dump = await dumpVisualTree('flatlist-basic'); + expect(dump).toMatchSnapshot(); + expect(JSON.stringify(dump)).toContain('LIST FOOTER'); + }); + + test('FlatList header should update correctly', async () => { + await searchBox('Basic'); + await goToFlatListExample('Basic'); + + // The basic example includes a header by default, verify it's rendered + const component = await app.findElementByTestID('flatlist-basic'); + await component.waitForDisplayed({timeout: 5000}); + + // Look for header content in the visual tree + const dump = await dumpVisualTree('flatlist-basic'); + expect(dump).toMatchSnapshot(); + expect(JSON.stringify(dump)).toContain('LIST HEADER'); + }); }); From 773f7d9c9f1677ae2591a22876f9c204ee560ed7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:38:40 +0000 Subject: [PATCH 3/4] Add change file for FlatList functional tests --- ...ct-native-windows-75516c9de09c70517cc57dc3854efed7.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-75516c9de09c70517cc57dc3854efed7.json diff --git a/change/react-native-windows-75516c9de09c70517cc57dc3854efed7.json b/change/react-native-windows-75516c9de09c70517cc57dc3854efed7.json new file mode 100644 index 00000000000..29d64830223 --- /dev/null +++ b/change/react-native-windows-75516c9de09c70517cc57dc3854efed7.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Add functional tests for FlatList component", + "packageName": "react-native-windows", + "email": "198982749+Copilot@users.noreply.github.com", + "dependentChangeType": "patch" +} \ No newline at end of file From e9802a1f426a7645b0f9982d74c62aa7c1e46d3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Jun 2025 20:58:22 +0000 Subject: [PATCH 4/4] Remove unnecessary comment as requested in review Co-authored-by: chiaramooney <34109996+chiaramooney@users.noreply.github.com> --- packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts b/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts index 617752a973a..8cb290af278 100644 --- a/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts +++ b/packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts @@ -127,7 +127,6 @@ describe('FlatList Tests', () => { expect(dump).toMatchSnapshot(); }); - // Functional tests for fast refresh scenarios test('FlatList styles should render correctly with multicolumn layout', async () => { await searchBox('Multi'); await goToFlatListExample('Multi Column');