Skip to content

refactor: replace custom Table component with markdown tables and improve test accessibility - #83

Merged
wghglory merged 2 commits into
mainfrom
topic/derek/cursor-post
Jan 11, 2026
Merged

wghglory merged 2 commits into
mainfrom
topic/derek/cursor-post

Conversation

@wghglory

Copy link
Copy Markdown
Owner

Summary

This PR refactors the codebase to use standard markdown table syntax instead of a custom React Table component, improves test accessibility by using semantic selectors, and updates ESLint configuration to properly handle e2e tests.

Changes

Core Changes

  • Removed custom Table component (components/share/MdxComponents/Table.tsx)
    • Deleted the custom React Table component
    • Removed Table from MDX components exports
    • Updated post creation rules to use standard markdown table syntax

Content Updates

  • Updated 5 blog posts to use markdown tables instead of custom Table component:
    • angular-component.mdx
    • angular-form.mdx
    • angular-pipe.mdx
    • angular-service.mdx
    • angular-structural-directive.mdx

Test Improvements

  • E2E tests (e2e/home.spec.ts):

    • Replaced generic locator() calls with semantic getByRole() selectors
    • Improved accessibility by using proper ARIA role-based queries
    • Updated navigation, links, buttons, and headings to use semantic selectors
    • Better test maintainability and alignment with accessibility best practices
  • Unit tests (components/hero/HeroSection.test.tsx):

    • Removed overly specific text content assertions that were brittle
    • Simplified test to check for element presence rather than exact text matching

Configuration Updates

  • ESLint config (eslint.config.mjs):
    • Added ignores: ['e2e/**'] to testing-library rules
    • Prevents testing-library rules from applying to Playwright e2e tests
    • Added clarifying comment about e2e test exclusion

Documentation

  • Updated docs/markdown-tables-support.md:
    • Removed references to custom Table component
    • Simplified documentation to focus on standard markdown table syntax

Breaking Changes

None. This is a refactoring that maintains the same visual output while using standard markdown syntax.

Testing Instructions

  1. Verify markdown tables render correctly:

    • Check blog posts that previously used Table component
    • Ensure tables display properly with correct styling
    • Test in both light and dark modes
  2. Run test suites:

    npm test
    npm run test:e2e
  3. Check linting:

    npm run lint

Code Review Notes

  • All markdown tables follow the standard syntax as documented
  • E2E tests now use more accessible and maintainable selectors
  • ESLint configuration properly excludes e2e tests from testing-library rules
  • No linting errors detected

Files Changed

  • .cursor/rules/post.mdc - Updated table generation rules
  • components/share/MdxComponents/Table.tsx - Deleted
  • components/share/MdxComponents/index.tsx - Removed Table export
  • components/hero/HeroSection.test.tsx - Simplified assertions
  • content/posts/*.mdx - Updated 5 posts to use markdown tables
  • docs/markdown-tables-support.md - Updated documentation
  • e2e/home.spec.ts - Improved accessibility selectors
  • eslint.config.mjs - Added e2e test exclusion

@vercel

vercel Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
my-website Building Building Jan 11, 2026 2:31pm

@netlify

netlify Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for derekw ready!

Name Link
🔨 Latest commit acd1d13
🔍 Latest deploy log https://app.netlify.com/projects/derekw/deploys/6963b3b5d4b71d000810149d
😎 Deploy Preview https://deploy-preview-83--derekw.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@wghglory wghglory left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Code Review Summary

Reviewed all changes in this PR. The refactoring is well-executed and follows best practices.

✅ Positive Changes

  1. Table Component Removal: Successfully removed custom Table component in favor of standard markdown tables, which is more maintainable and follows standard practices.

  2. ESLint Configuration: Properly excludes e2e Playwright tests from testing-library rules, preventing false positives.

  3. E2E Test Improvements: Excellent migration to semantic selectors using getByRole(), which improves:

    • Accessibility testing
    • Test maintainability
    • Alignment with Playwright best practices
  4. Content Updates: All markdown tables are properly formatted and maintain readability.

  5. Test Simplification: Removed brittle text assertions in unit tests, making them more maintainable.

Code Quality

  • No linting errors
  • No type safety issues
  • Proper code organization
  • Good test coverage maintained

No Issues Found

All changes follow project standards and best practices. Ready to merge! 🚀

@wghglory
wghglory merged commit d957ca2 into main Jan 11, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
Preview — acd1d13d Deployed Jan 11, 2026 by vercel[bot]
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.

1 participant