Skip to content

Commit 1f5e22b

Browse files
committed
docs: add URL parameter testing guide to README
- Document how to use d1 and d2 URL parameters for date simulation - Include examples for testing birthday popover behavior - Explain use cases for date parameter testing in development
1 parent d036054 commit 1f5e22b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,36 @@ The tests validate:
3535

3636
### Running Locally
3737

38-
3938
After installing dependencies, you can:
4039

4140
1. Execute `npm run dev` to start the local development server (Vite)
4241
2. Access the app at `http://localhost:5173`
4342
3. Use the date picker to calculate versions
4443
4. Check Leo's version and countdown
4544

45+
#### Testing with Specific Dates
46+
47+
You can simulate specific dates by passing URL parameters:
48+
49+
```url
50+
http://localhost:5173/?d1=YYYY-MM-DD&d2=YYYY-MM-DD
51+
```
52+
53+
- `d1`: Birth date (e.g., `2015-10-22`)
54+
- `d2`: Current date to simulate (e.g., `2025-10-22`)
55+
56+
**Examples:**
57+
58+
- Test birthday day: `http://localhost:5173/?d1=2015-10-22&d2=2025-10-22`
59+
- Test one day before birthday: `http://localhost:5173/?d1=2015-10-22&d2=2025-10-21`
60+
- Test custom dates: `http://localhost:5173/?d1=2015-10-22&d2=2025-12-25`
61+
62+
This is useful for:
63+
64+
- Testing the birthday popover message ("É hoje!" / "It's today!")
65+
- Validating date calculations without changing system time
66+
- E2E test development and debugging
67+
4668
## Progressive Web App (PWA)
4769

4870
This project is built as a [Progressive Web App](https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/), providing offline functionality and app-like experience.

0 commit comments

Comments
 (0)