Skip to content

Commit

Permalink
add scenario to MenuEdit performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
guvenkaranfil committed Jan 7, 2024
1 parent b1109dc commit 9f8df8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .perf-test.js/MenuEdit.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ import MenuEdit from '../app/tabs/menuEdit';
import AllProviders from '../.jest/helper/AllProviders';

import {MOCK_MENU_ITEMS} from '../__tests__/MenuEdit.test';
import {fireEvent, screen} from '@testing-library/react-native';

test('MenuEdit Component Performance', async () => {
const scenario = async (componentScreen: typeof screen) => {
const checkedItem = MOCK_MENU_ITEMS.filter(item => item.isActive)[0];
const checkedItemElement = componentScreen.getByTestId(checkedItem.id);

await fireEvent.press(checkedItemElement);
};

await measurePerformance(<MenuEdit menus={MOCK_MENU_ITEMS} />, {
scenario,
wrapper: AllProviders,
});
});

0 comments on commit 9f8df8f

Please sign in to comment.