8000 docs(test): add locale best practice (#28699) · ionic-team/ionic-framework@ae6c353 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae6c353

Browse files
authored
docs(test): add locale best practice (#28699)
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.
1 parent ec07e70 commit ae6c353

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/utils/test/playwright/docs/best-practices.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This guide details best practices that should be followed when writing E2E tests
1818
- [Test for positive and negative cases](#practice-positive-negative)
1919
- [Start your test with the configuration or layout in place if possible](#practice-test-config)
2020
- [Place your test closest to the fix or feature](#practice-test-close)
21+
- [Account for different locales when writing tests](#practice-locales)
2122

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

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

261262
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`.
263+
264+
<h2 id="practice-locales">Account for different locales when writing tests</h2>
265+
266+
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 commit comments

Comments
 (0)
0