Skip to content

Remove Danger warnings for changes in tests

What does this MR do and why?

This change removes data-testid warnings when only tests have changed. It preserves warnings when production code has changed.

As our tests are the ones validating the test ids, a change that only impacts tests wouldn't change the outcome of other higher tests: e.g. a refactor in our unit tests don't require review or re-run of e2e tests.

Screenshots or screen recordings

For example, we don't want this warning to be triggered by changes in the tests themselves:

Screenshot_2023-08-22_at_15.34.36

How to set up and validate locally

I added a mock commit with testid changes in both specs and production code and ran:

bundle exec rake danger_local

Screenshot_2023-08-29_at_10.00.09

Only production code is shown.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miguel Rincon

Merge request reports