Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions skill/agent-ready/references/scoring-rubric.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ README.md exists?
| 0-20 | No tests or only placeholder |
| 21-40 | Some unit tests, low coverage |
| 41-60 | Good unit tests, >50% coverage |
| 61-80 | Unit + integration, >80% coverage, systematic branch coverage |
| 81-100| BDT methodology: branch matrix tracked, all P0/P1 branches covered, mutation/property tests |
| 61-80 | Unit + integration, >80% coverage, branch matrix tracking conditions |
| 81-100| Full BDT methodology: all P0/P1 branches covered, mutation/property tests |

**Key quality indicators:**
- Do tests actually run and pass?
Expand Down
24 changes: 22 additions & 2 deletions skill/agent-ready/references/testing/test-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ describe('handleError', () => {
});
});

test('M02: string error shows default message', () => {
test('M02: Error without message shows default', () => {
handleError(new Error());
expect(mockToast).toHaveBeenCalledWith({
title: 'Error',
description: 'An error occurred',
variant: 'destructive',
});
});

test('M03: string error shows default message', () => {
handleError('string error');
expect(mockToast).toHaveBeenCalledWith({
title: 'Error',
Expand All @@ -81,7 +90,7 @@ describe('handleError', () => {
});
});

test('M03: null error shows default message', () => {
test('M04: null error shows default message', () => {
handleError(null);
expect(mockToast).toHaveBeenCalledWith(
expect.objectContaining({ description: 'An error occurred' })
Expand Down Expand Up @@ -198,6 +207,17 @@ describe('Feature Integration', () => {
});
});

test('L04: boundary - one below required → reject', async () => {
setupCredits({ amount: 9, isPremium: false }); // 10 required, have 9
render(<Feature />);

await userEvent.click(screen.getByRole('button', { name: /submit/i }));

await waitFor(() => {
expect(screen.getByText(/insufficient/i)).toBeVisible();
});
});

test('L05: premium user → skip credit check', async () => {
setupCredits({ amount: 0, isPremium: true });
setupAPI({ success: true });
Expand Down
2 changes: 1 addition & 1 deletion skill/agent-ready/references/testing/testing-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Goal: Final confirmation

## Creating Real Test Conditions

**核心原则: 用户不是测试人员。上线前必须覆盖真实条件,没有条件就创造条件。**
**Core principle: Users are not testers. Before going live, cover all real conditions — if conditions don't exist, create them.**

### Why This Matters

Expand Down
Loading