Skip to content

Sprint 4 PR.#9

Open
qopci wants to merge 11 commits intokellerflint:mainfrom
qopci:main
Open

Sprint 4 PR.#9
qopci wants to merge 11 commits intokellerflint:mainfrom
qopci:main

Conversation

@qopci
Copy link
Copy Markdown

@qopci qopci commented Nov 13, 2025

Diana K. & Laura V.

🧩 Summary

This PR adds unit testing coverage for both the frontend and backend of the project.
Tasks 1 and 2 (Backend Unit Tests and Frontend Unit Tests) have been completed successfully.
However, we encountered some ongoing challenges while working on Task 3 (Integration Tests) and Task 4 (End-to-End Tests).

🧪 Tasks Overview

✅ Task 1: Backend Unit Tests

Implemented unit tests for the Node/Express backend using Jest.

Highlights:

  • Jest installed and configured
  • Mocked database calls in service functions
  • Added test scripts in package.json
  • Coverage reports generated successfully
  • Tests documented in README

✅ Task 2: Frontend Unit Tests

Implemented tests for React components using Jest and React Testing Library.

Highlights:

  • Tested component rendering and user interactions
  • Verified event handling (clicks, inputs, etc.)
  • All frontend tests pass
  • Coverage report generated and documented

⚠️ Task 3: Integration Tests (In Progress)

We began setting up integration tests to verify backend API endpoints with a test database.

Issues Encountered:

  • Test database configuration not connecting consistently
  • Difficulty seeding or resetting test data between runs
  • Some endpoint tests interfere with development DB

⚠️ Task 4: End-to-End Tests (Pending)

Started setting up Cypress for E2E testing to cover full user flows.

Issues Encountered:

  • Cypress configuration not fully recognizing local backend routes
  • Timing issues between frontend/backend containers
  • Need to stabilize environment for complete workflow testing

🛠️ Technologies Used

  • Docker & Docker Compose — containerization and environment setup
  • Jest — Unit testing framework
  • React Testing Library — Frontend testing utilities
  • Cypress — E2E testing tool
  • Node.js / Express — Backend API
  • React.js — Frontend UI

⚠️ Known Issues

  • Integration tests currently fail due to test database connection issues
  • E2E tests need environment synchronization between services
  • Some async operations require proper mocking or test delays

Frontend and backend unit tests run successfully and pass all cases.
Integration and E2E testing require further debugging and setup refinement.

test("opens and closes clear drawing dialog", () => {
render(<PixelForm />);

// Find the Clear icon and click its parent button
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remember to remove comments before pushing code. The it() area should probably describe what these tests do

testEnvironment: "jsdom",
transform: {
"^.+\\.[tj]sx?$": ["babel-jest", { configFile: "./babel.config.js" }],
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I suggest using Vitest for the front end instead of Jest as Jest is experimental when it comes to ESM/Modules and causes more issues while Vitest is very React friendly

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.

4 participants