From 703f337da5e888308682473ad015f343e9a2947b Mon Sep 17 00:00:00 2001 From: Github Date: Tue, 29 Oct 2024 14:36:18 +0100 Subject: [PATCH] update guidelines to avoid redundant tests --- contributingGuides/REASSURE_PERFORMANCE_TEST.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contributingGuides/REASSURE_PERFORMANCE_TEST.md b/contributingGuides/REASSURE_PERFORMANCE_TEST.md index ec5663799113..e4fc73b0b9ae 100644 --- a/contributingGuides/REASSURE_PERFORMANCE_TEST.md +++ b/contributingGuides/REASSURE_PERFORMANCE_TEST.md @@ -9,6 +9,10 @@ We use Reassure for monitoring performance regression. It helps us check if our ## Performance Testing Strategy (`measureRenders`) +- Before adding new tests, check if the proposed scenario or component is already covered in existing tests. Duplicate tests can slow down the CI suite, making it harder to spot meaningful regressions. +- Review the current test suite to ensure your test scenario or component isn’t already being tested elsewhere. +- Test only scenarios that cover new or unique interactions. Avoid testing repetitive user actions that could be captured within a single, comprehensive scenario. +- Where applicable, use utility functions and helper methods to consolidate common actions (e.g., data mocking, scenario setup) across tests. This reduces redundancy and allows tests to be more focused and reusable. - The primary focus is on testing business cases rather than small, reusable parts that typically don't introduce regressions, although some tests in that area are still necessary. - To achieve this goal, it's recommended to stay relatively high up in the React tree, targeting whole screens to recreate real-life scenarios that users may encounter. - For example, consider scenarios where an additional `useMemo` call could impact performance negatively.