Add AI instructions for repo guidelines and testing best practises#479
Merged
aurorascharff merged 14 commits intomainfrom Feb 19, 2026
Merged
Add AI instructions for repo guidelines and testing best practises#479aurorascharff merged 14 commits intomainfrom
aurorascharff merged 14 commits intomainfrom
Conversation
…lity with aria attributes
…and add comprehensive tests
….config.ts for type checking
test: update MdPagination tests to use role-based queries for accessibility
… and MdRadioGroup
… refactor-tests
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive AI agent instructions and refactors tests to follow accessibility-first best practices. It adds the AGENTS.md file with detailed guidelines for AI assistants working on this React component library, updates the README to reference these guidelines, and rewrites test files to use accessible queries (getByRole, getByLabelText) instead of less accessible alternatives.
Changes:
- Added AGENTS.md with comprehensive testing best practices, component guidelines, and accessibility requirements
- Refactored test files to use accessible queries (getByRole over getByLabelText, screen.getByTestId over container.querySelector)
- Enhanced test assertions to always include toHaveBeenCalledTimes before toHaveBeenCalledWith
- Updated TypeScript configuration to include Vitest globals and jest-dom types
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| AGENTS.md | New comprehensive guide for AI agents with testing best practices, folder structure, accessibility requirements, and PR guidelines |
| .github/copilot-instructions.md | Simple reference file pointing to AGENTS.md for GitHub Copilot integration |
| README.md | Added AI-verktøy section documenting the new AI agent instructions and testing best practices note |
| packages/react/tsconfig.json | Added Vitest globals and jest-dom types for proper TypeScript support |
| packages/react/src/pagination/tests/MdPagination.test.tsx | Refactored to use getByRole('button') with name option, added toHaveBeenCalledTimes assertions, improved test descriptions |
| packages/react/src/formElements/tests/MdRadioGroup.test.tsx | Replaced container.querySelector with screen.getByTestId for consistency |
| packages/react/src/formElements/tests/MdCheckboxGroup.test.tsx | Replaced container.querySelector with screen.getByTestId for consistency |
| packages/react/src/accordion/tests/MdAccordion.test.tsx | Replaced container.querySelector with screen.getByTestId for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Add AI instructions and rewrite all tests to be best practise
Checklist before requesting a review
major,minororpatch)stories-folder?packages/react/index.tsx?packages/css/index.css?