Skip to content

Feature/add missing unit tests #85

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 20 commits into
base: main
Choose a base branch
from

Conversation

Jordan231111
Copy link

This pull request introduces a variety of changes, including the addition of mock implementations for testing, updates to existing component mocks, new test cases for components, and improvements to test assertions and styling checks. Below is a categorized summary of the most important changes:

Mock Implementations for Testing

  • Added mock implementations for jQuery and jQuery UI to facilitate testing, including specific mocks for autocomplete functionality (__mocks__/jquery.js, __mocks__/jquery-ui.js, __mocks__/jquery-ui/ui/widgets/autocomplete.js). [1] [2] [3]

Component Updates

  • Refactored the MockFooter component to include a more detailed structure and updated its mock content to reflect the HackRPI branding (__tests__/__mocks__/mockRegistry.tsx).

New Component Tests

  • Added comprehensive tests for the EventCard component, including functionality for editing, deleting, and toggling visibility of events (__tests__/components/EventCard.test.tsx).
  • Introduced tests for the Game Board component to validate grid rendering, value display, and structural styling (__tests__/components/game/board.test.tsx).
  • Added tests for the Game Tile component to verify rendering of different values and corresponding styles (__tests__/components/game/tile.test.tsx).

Improvements to Existing Tests

  • Enhanced assertions in the AboutUs component tests to improve robustness, including checks for partial matches and updated styling expectations (__tests__/components/about-us.test.tsx). [1] [2]
  • Updated Footer component tests to verify new gradient styling and layout classes (__tests__/components/footer.test.tsx).
  • Adjusted Event Page tests to remove an invalid expectation for the Footer component, which is no longer rendered in the page (__tests__/components/event.test.tsx).

@github-actions github-actions bot force-pushed the feature/add-missing-unit-tests branch from d42c60b to c1cac66 Compare May 23, 2025 20:49
…s for consistency and update background image syntax in sponsors component
@github-actions github-actions bot force-pushed the feature/add-missing-unit-tests branch from 61ec079 to fe80fd7 Compare May 23, 2025 20:58
@github-actions github-actions bot force-pushed the feature/add-missing-unit-tests branch from c5c4ccf to bc53319 Compare May 23, 2025 21:05
@github-actions github-actions bot force-pushed the feature/add-missing-unit-tests branch from 552220a to 406aa72 Compare May 23, 2025 21:15
@github-actions github-actions bot force-pushed the feature/add-missing-unit-tests branch from 9317dde to b9d73b5 Compare May 23, 2025 21:32
@Jordan231111
Copy link
Author

This pull request includes several changes across workflows, pre-commit hooks, mock files, and test files. The most significant updates involve removing the linting job from the GitHub Actions workflow, enhancing pre-commit checks, introducing mock implementations for testing, and updating test cases for improved accuracy and coverage.

Workflow and Pre-commit Updates:

  • .github/workflows/nextjs.yml: Removed the lint job entirely, simplifying the CI pipeline. The build job now directly depends on the changes job instead of lint.
  • .husky/pre-commit: Replaced individual TypeScript, Prettier, and ESLint checks with a unified lint-staged command for pre-commit hooks to streamline code validation.

Mock Implementations for Testing:

  • __mocks__/jquery-ui.js, __mocks__/jquery-ui/ui/widgets/autocomplete.js, and __mocks__/jquery.js: Added mock implementations for jQuery and jQuery UI components to facilitate testing without relying on external libraries. [1] [2] [3]

Test Enhancements:

  • __tests__/components/EventCard.test.tsx: Introduced comprehensive tests for the EventCard component, covering editing, updating, visibility toggling, and deletion functionalities.
  • __tests__/components/about-us.test.tsx and __tests__/components/event.test.tsx: Updated assertions for theme descriptions, banner styles, and layout components to improve test accuracy and robustness. [1] [2] [3]

Style and Configuration Changes:

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