Skip to content

Tests for backend & frontend#22

Merged
dalvy07 merged 2 commits into
developfrom
feature/tests
Nov 19, 2025
Merged

Tests for backend & frontend#22
dalvy07 merged 2 commits into
developfrom
feature/tests

Conversation

@r1ckshot

Copy link
Copy Markdown
Collaborator
  • Додав testy jednostkowe i integracyjne для бекенду та фронтенду.

  • Зробив це для того, щоб показати Бадуровічу на проекті ну і перевірити чи все працює))

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit and integration tests for both the backend (Java/Spring Boot) and frontend (React/TypeScript) of the anomaly detection application.

  • Introduces Jest configuration with MSW (Mock Service Worker) for frontend API mocking
  • Adds unit tests for authentication, audio processing, and WebSocket functionality
  • Implements integration tests that verify the interaction between multiple components
  • Configures test infrastructure including polyfills, mocks, and test data sources

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
frontend/src/setupTests.ts Configures Jest test environment with MSW server and react-i18next mocks
frontend/src/mocks/handlers.ts Defines MSW request handlers for mocking API endpoints in tests
frontend/src/tests/useWebSocketIntegration.test.ts Integration tests for WebSocket context functionality
frontend/src/tests/useWebSocket.test.ts Unit tests for WebSocket hook with pause/resume functionality
frontend/src/tests/apiIntegration.test.ts Integration tests for API service with authorization
frontend/src/tests/api.test.ts Unit tests for API service request handling
frontend/src/tests/AuthContextIntegration.test.ts Integration tests for authentication context flows
frontend/src/tests/AuthContext.test.ts Unit tests for authentication context login/logout
frontend/src/tests/AudioUploadIntegration.test.tsx Integration tests for audio upload component
frontend/src/tests/AudioUpload.test.tsx Unit tests for audio upload component rendering
frontend/src/App.test.tsx Removes default create-react-app test file
frontend/package.json Adds test dependencies: msw, jest-fetch-mock, undici, web-streams-polyfill
frontend/jest.polyfills.js Provides polyfills for Node.js APIs needed by test environment
frontend/craco.config.js Configures Jest with custom transforms, module mappings, and polyfills
frontend/mocks/react-router-dom.tsx Mock implementation of react-router-dom for testing
backend/src/test/resources/application.yml Test configuration with H2 in-memory database and test JWT settings
backend/src/test/java/com/anomaly/detection/util/JwtUtilTest.java Unit tests for JWT token generation and validation
backend/src/test/java/com/anomaly/detection/service/AuthServiceTest.java Unit tests for authentication service with mocked dependencies
backend/src/test/java/com/anomaly/detection/service/AuthServiceIntegrationTest.java Integration tests for authentication service with real database
backend/src/test/java/com/anomaly/detection/service/AudioProcessingServiceTest.java Unit tests for WAV file validation and parsing
backend/src/test/java/com/anomaly/detection/controller/AudioControllerIntegrationTest.java Integration tests for audio controller endpoints
backend/pom.xml Adds test dependencies: Mockito and H2 database
backend/.idea/misc.xml Updates IDE configuration from JDK 23 to JDK 21
Files not reviewed (1)
  • backend/.idea/misc.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/__tests__/AudioUploadIntegration.test.tsx
Comment thread backend/pom.xml
Comment thread backend/.idea/misc.xml
Comment thread frontend/jest.polyfills.js
Comment thread backend/src/test/resources/application.yml
Comment thread frontend/src/__tests__/useWebSocketIntegration.test.ts
Comment thread frontend/src/__tests__/AudioUpload.test.tsx
Comment thread frontend/src/__tests__/AuthContextIntegration.test.ts
Comment thread frontend/src/__tests__/AuthContextIntegration.test.ts
@dalvy07 dalvy07 merged commit 4af2e35 into develop Nov 19, 2025
8 checks passed
@r1ckshot r1ckshot deleted the feature/tests branch November 19, 2025 16:02
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