Squashed commit message
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled

This commit is contained in:
2026-03-11 22:08:41 +03:00
commit f329bfa9d9
585 changed files with 65605 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
# Prompts for testing
## Creating a unit test
```
Create a unit test for [CLASS_NAME] in tests/Unit/:
1. Use PHPUnit
2. Cover all public methods
3. Test successful scenarios
4. Test error handling
5. Use mocks for dependencies
6. Follow the structure of existing tests
7. Use the project's base TestCase class
```
## Creating an integration test
```
Create an integration test for [FEATURE_NAME] in tests/Integration/:
1. Test the full flow from request to response
2. Use a test database
3. Clean up data after tests
4. Test real-life usage scenarios
5. Verify data validation
6. Verify error handling
```
## Creating a Vue component test
```
Create a test for Vue component [COMPONENT_NAME] in frontend/[admin|spa]/tests/:
1. Use Vitest
2. Test component rendering
3. Test props
4. Test events (emits)
5. Test user interactions
6. Use mocks for API calls
7. Follow the structure of existing tests
```
## Test coverage
```
Analyze test coverage for [FILE_PATH]:
1. Determine which methods are not covered by tests
2. Create tests for critical methods
3. Ensure edge cases are tested
4. Add tests for error handling
```