Skip to content

Commit 0bb7a7f

Browse files
committed
Updates to test documentation with accessible Mermaid diagrams
1 parent aa9cdc4 commit 0bb7a7f

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ tests/
5353
PHP unit tests for theme functions and classes.
5454

5555
**Run:**
56+
5657
```bash
5758
npm run test:php
5859
```
5960

6061
**Files:**
62+
6163
- `test-theme-setup.php`
6264
- `test-block-patterns.php`
6365
- `test-block-styles.php`
@@ -68,12 +70,14 @@ npm run test:php
6870
JavaScript unit tests for theme scripts.
6971

7072
**Run:**
73+
7174
```bash
7275
npm run test:js
7376
npm run test:js:watch # Watch mode
7477
```
7578

7679
**Files:**
80+
7781
- `tests/js/*.test.js`
7882
- `tests/bin/*.test.js`
7983

@@ -82,11 +86,13 @@ npm run test:js:watch # Watch mode
8286
End-to-end browser tests.
8387

8488
**Run:**
89+
8590
```bash
8691
npm run test:e2e
8792
```
8893

8994
**Files:**
95+
9096
- `tests/e2e/*.spec.js`
9197

9298
## Test Flow

tests/bin/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ flowchart LR
2828
Tests for the build orchestration script.
2929

3030
**What it tests:**
31+
3132
- Build initialization
3233
- Asset compilation
3334
- Distribution package creation
@@ -38,6 +39,7 @@ Tests for the build orchestration script.
3839
Tests for the theme generation script.
3940

4041
**What it tests:**
42+
4143
- Theme scaffold creation
4244
- Placeholder replacement
4345
- File copying

tests/e2e/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ flowchart TB
3636
End-to-end tests for theme functionality.
3737

3838
**Tests:**
39+
3940
- Page loading and rendering
4041
- Navigation functionality
4142
- Block interactions
@@ -46,6 +47,7 @@ End-to-end tests for theme functionality.
4647
Example test demonstrating Playwright patterns.
4748

4849
**Demonstrates:**
50+
4951
- Page navigation
5052
- Element selection
5153
- User interactions
@@ -91,16 +93,16 @@ test('homepage loads correctly', async ({ page }) => {
9193
```javascript
9294
test('navigation menu works', async ({ page }) => {
9395
await page.goto('/');
94-
96+
9597
// Click menu button
9698
await page.click('.menu-toggle');
97-
99+
98100
// Verify menu is visible
99101
await expect(page.locator('.nav-menu')).toBeVisible();
100-
102+
101103
// Click menu item
102104
await page.click('a[href="/about"]');
103-
105+
104106
// Verify navigation
105107
await expect(page).toHaveURL(/\/about/);
106108
});
@@ -111,11 +113,11 @@ test('navigation menu works', async ({ page }) => {
111113
```javascript
112114
test('search form works', async ({ page }) => {
113115
await page.goto('/');
114-
116+
115117
// Fill search form
116118
await page.fill('[name="s"]', 'test query');
117119
await page.click('[type="submit"]');
118-
120+
119121
// Verify results page
120122
await expect(page).toHaveURL(/\?s=test\+query/);
121123
await expect(page.locator('.search-results')).toBeVisible();
@@ -127,10 +129,10 @@ test('search form works', async ({ page }) => {
127129
```javascript
128130
test('visual regression', async ({ page }) => {
129131
await page.goto('/');
130-
132+
131133
// Take screenshot
132134
await page.screenshot({ path: 'screenshots/homepage.png' });
133-
135+
134136
// Screenshot specific element
135137
const header = page.locator('header');
136138
await header.screenshot({ path: 'screenshots/header.png' });

tests/js/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ flowchart LR
2828
Tests for frontend theme JavaScript.
2929

3030
**Coverage:**
31+
3132
- DOM manipulation
3233
- Event handlers
3334
- Utility functions
@@ -38,6 +39,7 @@ Tests for frontend theme JavaScript.
3839
Example test file demonstrating testing patterns.
3940

4041
**Demonstrates:**
42+
4143
- Jest syntax
4244
- Test structure
4345
- Assertions

0 commit comments

Comments
 (0)