Skip to content

Commit 123250d

Browse files
committed
cleanup
1 parent fe563b7 commit 123250d

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -262,26 +262,26 @@ BETTER_AUTH_URL=http://localhost:3000
262262

263263
### Testing
264264

265+
#### Unit/Component Tests
266+
265267
```bash
266-
# Run all tests
267-
pnpm test
268+
pnpm test # Run all tests
269+
pnpm test --watch # Watch mode
270+
pnpm test --coverage # With coverage
271+
```
268272

269-
# Run tests in watch mode
270-
pnpm test --watch
273+
Uses Vitest + Testing Library + MSW.
271274

272-
# Run tests with coverage
273-
pnpm test --coverage
275+
#### BDD E2E Tests (Cucumber + Playwright)
274276

275-
# Run specific test file
276-
pnpm test src/components/navbar.test.tsx
277+
```bash
278+
pnpm exec playwright install # One-time browser install
279+
pnpm dev # Start dev stack
280+
pnpm run test:bdd # Run scenarios (headless)
281+
pnpm run test:bdd:debug # With Playwright Inspector
282+
pnpm run test:bdd:trace # Capture traces
277283
```
278284

279-
Tests use:
280-
281-
- **Vitest** - Test runner
282-
- **Testing Library** - React component testing
283-
- **MSW** - API mocking
284-
285285
### Mock Server
286286

287287
The project includes a standalone MSW mock server for development:

tests/bdd/features/catalog.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Feature: Catalog page
33
Scenario: View catalog page header
44
Given I am logged in
55
And I am on "/catalog"
6-
Then I should see a heading "MCP Server Catalog"
6+
Then I should see an "MCP Server Catalog" heading

tests/bdd/features/login.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Login flow
44
Given I am on "/signin"
55
When I click on the "Okta" button
66
Then I should be on "/catalog"
7-
And I should see a heading "MCP Server Catalog"
7+
And I should see an "MCP Server Catalog" heading
88

99
Scenario: Log out from Catalog
1010
Given I am logged in

tests/bdd/steps/global.steps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Then(
2626
);
2727

2828
Then(
29-
"I should see a heading {string}",
30-
async function (this: PlaywrightWorld, heading: string) {
29+
"I should see {article} {string} heading",
30+
async function (this: PlaywrightWorld, _article: null, heading: string) {
3131
await expect(
3232
this.requirePage().getByRole("heading", { name: heading }),
3333
).toBeVisible();

tests/bdd/support/parameter-types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ defineParameterType({
1717
throw new Error(`Unknown role phrase "${text}".`);
1818
},
1919
});
20+
21+
defineParameterType({
22+
name: "article",
23+
useForSnippets: false,
24+
regexp: /a|an/,
25+
transformer: () => null,
26+
});

0 commit comments

Comments
 (0)