Skip to content

Commit 1f38148

Browse files
Copilotzhpenkov
andcommitted
fix(pager): replace manual HTML test with proper TSX test and update guidelines
Co-authored-by: zhpenkov <[email protected]>
1 parent e83457a commit 1f38148

File tree

3 files changed

+37
-223
lines changed

3 files changed

+37
-223
lines changed

.github/copilot-instructions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,24 @@ npm run clean # Full cleanup (includes node_modules)
318318
- **Linting** - Enforced on all commits via Husky + lint-staged
319319
- **Accessibility tests** - Run automatically on default-ocean-blue-a11y swatch
320320

321+
#### HTML Test File Creation Rules
322+
323+
- **DO NOT** create `.html` files directly in `tests/component/` folders
324+
- **DO** create `.tsx` test files in `packages/html/src/{component}/tests/` folder
325+
- **Use existing components** from the respective component spec and templates
326+
- **Keep tests simple** - they are for visual purposes only, no complex functionality
327+
- **Follow naming convention** - use descriptive names like `component-feature.tsx`
328+
- **HTML files are auto-generated** - CI will automatically generate HTML files from TSX tests
329+
330+
#### Test File Structure
331+
```
332+
packages/html/src/{component}/
333+
├── {component}.spec.tsx # Component specifications
334+
├── templates/ # Reusable component templates
335+
└── tests/ # Test scenarios (create .tsx files here)
336+
└── {test-name}.tsx # Individual test files
337+
```
338+
321339
## Common Issues
322340

323341
- **Unit tests failing**: Run `npm run docs` first to generate metadata
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Pager } from "../../pager";
2+
3+
export default () => (
4+
<>
5+
<div id="test-area" className="k-d-grid k-grid-cols-1">
6+
<span>Small pager with 100 items per page</span>
7+
<Pager size="small" itemsPerPage={100} responsive={false} />
8+
9+
<span>Medium pager with 500 items per page</span>
10+
<Pager size="medium" itemsPerPage={500} responsive={false} />
11+
12+
<span>Large pager with 1000 items per page</span>
13+
<Pager size="large" itemsPerPage={1000} responsive={false} />
14+
15+
<span>Large pager with 10000 items per page (should demonstrate clipping)</span>
16+
<Pager size="large" itemsPerPage={10000} responsive={false} />
17+
</div>
18+
</>
19+
);

tests/pager/pager-large-sizes-test.html

Lines changed: 0 additions & 223 deletions
This file was deleted.

0 commit comments

Comments
 (0)