Skip to content

Spec meta 2 #5512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Spec meta 2 #5512

wants to merge 3 commits into from

Conversation

kirchoni
Copy link
Contributor

🧪 Add Jest Testing Infrastructure and Enforce Component Interface for HTML Package

related to https://github.com/telerik/sakura-ai/pull/30

Turns our all of our specs have the className attached, so this PR only future-proofs this so we can use it as a foundation for our component-level customization in SakurAI

Changes Summary

1. Component Interface Enforcement

  • Introduced KendoComponent<P> interface in _types/component.ts to standardize component contracts
  • Updated all 180+ React component spec files to implement the KendoComponent interface
  • Ensures all components have a required className static property

2. Automated Component Validation

  • Created comprehensive test suite (component-requirements.test.ts) that:
    • Dynamically discovers all exported components from index.ts
    • Validates each component has the required className static property
    • Provides detailed logging for debugging and verification

Benefits

  • ✅ Enforces consistent component interface across all HTML specs components
  • ✅ Automated testing prevents components from missing required properties
  • ✅ Centralized component requirements hopefully reduces inconsistencies

kirchoni added 2 commits July 8, 2025 14:45
- Add KendoComponent interface requiring className static property
- Update all component declarations to use KendoComponent<T> type
- Ensure type safety and consistent component structure across codebase
- Add automation script for future component enforcement
- Created jest.config.js to configure Jest with TypeScript and jsdom.
- Updated package.json to include Jest and related dependencies, along with test scripts.
- Added component-requirements.test.ts to dynamically generate tests based on exports from index.ts.
- Implemented setup.ts for Jest to include necessary global configurations and mocks.
@kirchoni kirchoni requested a review from a team as a code owner July 11, 2025 10:32
Copy link

github-actions bot commented Jul 11, 2025

Packages Report

core default classic bootstrap material fluent utils
Size 29.15 KB (0.0%) 781.89 KB (0.0%) 781.90 KB (0.0%) 793.97 KB (0.0%) 927.47 KB (0.0%) 1152.31 KB (0.0%) 625.19 KB (0.0%)
Gzip Size 4.85 KB (0.0%) 101.05 KB (0.0%) 101.33 KB (0.0%) 103.41 KB (0.0%) 114.48 KB (0.0%) 136.53 KB (0.0%) 52.16 KB (0.0%)
Compile Time 1 s (0.0%) 3 s (0.0%) 3 s (0.0%) 3 s (0.0%) 3 s (0.0%) 4 s (0.0%) 3 s (0.0%)

@Juveniel
Copy link
Contributor

do we want to also include the tests in the CI ?

@kirchoni
Copy link
Contributor Author

Not sure tbh. If we have no problem with adding a couple of seconds to the CI, we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants