Skip to content

Commit

Permalink
docs(test): add locale best practice (#28699)
Browse files Browse the repository at this point in the history
This best practice currently resides in our internal testing process
docs. I think this is valuable information for contributors to have as
well, so I've added it to our public best practices doc.
  • Loading branch information
liamdebeasi authored Dec 13, 2023
1 parent ec07e70 commit ae6c353
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/utils/test/playwright/docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This guide details best practices that should be followed when writing E2E tests
- [Test for positive and negative cases](#practice-positive-negative)
- [Start your test with the configuration or layout in place if possible](#practice-test-config)
- [Place your test closest to the fix or feature](#practice-test-close)
- [Account for different locales when writing tests](#practice-locales)

<h2 id="practice-test">Use the customized `test` function</h2>

Expand Down Expand Up @@ -259,3 +260,7 @@ This allows tests to remain fast on CI as we can focus on the test itself instea
<h2 id="practice-test-close">Place your test closest to the fix or feature</h2>

Tests should be placed closest to where the fix or feature was implemented. This means that if a fix was written for `ion-button`, then the test should be placed in `src/components/button/tests`.

<h2 id="practice-locales">Account for different locales when writing tests</h2>

Tests ran on CI may not run on the same locale as your local machine. It's always a good idea to apply locale considerations to components that support it, when writing tests (i.e. `ion-datetime` should specify `locale="en-US"`).

0 comments on commit ae6c353

Please sign in to comment.