Skip to content

Conversation

@Narbin
Copy link
Contributor

@Narbin Narbin commented Jan 21, 2026

No description provided.

Introduces Playwright-based test helpers and test suites for SEO, performance, and social media meta tags. Adds new exports in the tests module, updates .gitignore for Playwright artifacts, and declares Playwright as a peer dependency in package.json.
Introduces a new test suite under src/tests and helpers for validating SEO, performance, and social media meta tags using Playwright. Adds build scripts, exports, and TypeScript config for test code. Removes test exports from main index to keep test utilities separate from the main package exports.
Converted all test suite and helper module exports from ES module syntax to CommonJS for compatibility. Updated import statements to use require and adjusted function exports accordingly in dist/helpers/TestsHelper.js, dist/tests/index.js, and all test suite files.
Renamed test suite functions for consistency (e.g., SeoTest_* to TestSeo_*), added skip logic and improved error reporting for image and iframe tests, and introduced new helper functions for element existence and content checks. Updated type definitions and testDist outputs accordingly. Social media tests now support additional Open Graph and Twitter meta tags.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds Playwright-based end-to-end testing infrastructure to the hat-ring-components library. The changes introduce reusable test suites for validating SEO metadata, performance optimizations (like lazy loading), and social media tags (Open Graph and Twitter Cards).

Changes:

  • Added Playwright test suites for SEO, performance, and social media validation with configurable test functions
  • Created TypeScript configuration for compiling tests to CommonJS in testDist/ directory
  • Added Grid component exports (Grid, Box, Container) to main package exports

Reviewed changes

Copilot reviewed 15 out of 28 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tsconfig.tests.json TypeScript configuration for test compilation with CommonJS output
src/tests/types.ts TypeScript interfaces for Playwright test wrapper types
src/tests/suites/seo.test.ts SEO validation tests for title, meta tags, structured data, and accessibility
src/tests/suites/performance.test.ts Performance tests for image lazy-loading and iframe optimization
src/tests/suites/socialMedia.test.ts Tests for Open Graph and Twitter Card meta tags
src/tests/index.ts Central export file for all test suites
src/helpers/TestsHelper.ts Helper functions for extracting meta content and structured data from pages
package.json Added Playwright peer dependencies and build scripts for tests
.gitignore Added Playwright-specific ignore patterns
src/index.ts Exported Grid layout components
testDist/** Compiled JavaScript output from TypeScript (all files)

Updated the 'build:tests' and 'run:tests' npm scripts to include the --clean flag, ensuring a clean build for test projects.
Removed unnecessary --clean flag from test build scripts in package.json. Improved formatting and variable usage in performance and SEO test suites for better readability and correctness.
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.

3 participants