Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add functional tests for FlatList component",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
62 changes: 62 additions & 0 deletions packages/e2e-test-app-fabric/test/FlatListComponentTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,66 @@ describe('FlatList Tests', () => {
const dump = await dumpVisualTree('flatlist-nested');
expect(dump).toMatchSnapshot();
});

// Functional tests for fast refresh scenarios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot delete line 130

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 130 deleted as requested in commit e9802a1.

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');
});
});
Loading