Skip to content

Fix TypeScript types and dependencies#14

Open
bhrionn wants to merge 1 commit into
mainfrom
claude/fix-typescript-dependencies-011e4FLsXzCx5HvAuoWAL1tq
Open

Fix TypeScript types and dependencies#14
bhrionn wants to merge 1 commit into
mainfrom
claude/fix-typescript-dependencies-011e4FLsXzCx5HvAuoWAL1tq

Conversation

@bhrionn

@bhrionn bhrionn commented Nov 18, 2025

Copy link
Copy Markdown
Owner

Fixed all TypeScript type errors across web-app test files:

  • FileUploadForm.test.tsx: Prefixed unused mock parameters with underscore
  • LoginPage.test.tsx: Removed unused imports (BrowserRouter, User type) and variables
  • ErrorLoggingService.test.ts: Added missing IApiClient methods to mock, fixed NODE_ENV mocking
  • NotificationService.test.ts: Added missing IToastContext methods to mock
  • accessibility.test.ts: Removed unused trapFocus import

All workspaces (web-app, api, infrastructure) now pass TypeScript type checking and build successfully.

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Infrastructure change
  • Performance improvement
  • Code refactoring

Related Issues

Closes #

Changes Made

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated
  • Manual testing completed

Test Results

# Paste test results here

Security Considerations

  • No security implications
  • Security review required
  • Secrets/credentials properly handled
  • Input validation implemented
  • Authentication/authorization checked

Deployment Notes

  • Database migrations required
  • Environment variables changed
  • Infrastructure changes required
  • Breaking API changes
  • Requires manual deployment steps

Migration Steps

# Add migration commands here

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated
  • No new warnings generated
  • Tests pass locally
  • Dependent changes merged
  • Security scan passed
  • Performance impact considered

Screenshots

Additional Context

Reviewer Notes


Deployment Target:

  • Development
  • Staging
  • Production (requires additional approval)

Fixed all TypeScript type errors across web-app test files:
- FileUploadForm.test.tsx: Prefixed unused mock parameters with underscore
- LoginPage.test.tsx: Removed unused imports (BrowserRouter, User type) and variables
- ErrorLoggingService.test.ts: Added missing IApiClient methods to mock, fixed NODE_ENV mocking
- NotificationService.test.ts: Added missing IToastContext methods to mock
- accessibility.test.ts: Removed unused trapFocus import

All workspaces (web-app, api, infrastructure) now pass TypeScript type checking and build successfully.
Copilot AI review requested due to automatic review settings November 18, 2025 13:47
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @bhrionn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the robustness and maintainability of the codebase by addressing and resolving all identified TypeScript type errors within the web-app's test files. The changes ensure that the entire project, including web-app, API, and infrastructure workspaces, now successfully passes TypeScript type checking and builds without issues, contributing to a more stable development environment.

Highlights

  • TypeScript Type Fixes: Resolved various TypeScript type errors and warnings across several web-app test files, ensuring type safety and reducing potential runtime issues.
  • Build Success Across Workspaces: Ensured all workspaces (web-app, api, infrastructure) now pass TypeScript type checking and build successfully, contributing to a more stable development environment.
  • Test File Refinements: Cleaned up test files by removing unused imports, variables, and adjusting mock implementations for better type adherence and clarity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request does a great job of cleaning up TypeScript type errors and removing unused code across several test files. The changes improve code quality and maintainability. I have one suggestion to make the environment variable mocking in ErrorLoggingService.test.ts more robust to prevent test state leakage.

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 fixes TypeScript type errors across web-app test files to ensure all workspaces pass TypeScript type checking. The changes address missing mock methods, unused variables/imports, and improper environment variable mocking.

  • Removed unused imports and variables from test files
  • Added missing mock methods to test interfaces to match their implementations
  • Fixed NODE_ENV mocking to use proper property descriptors
  • Prefixed unused mock parameters with underscore

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web-app/src/utils/tests/accessibility.test.ts Removed unused trapFocus import
web-app/src/services/tests/NotificationService.test.ts Added missing IToastContext methods to mock and added type assertion
web-app/src/services/tests/ErrorLoggingService.test.ts Added missing IApiClient methods, removed deprecated methods, and fixed NODE_ENV mocking
web-app/src/pages/tests/LoginPage.test.tsx Removed unused imports (BrowserRouter, User) and unused variables
web-app/src/components/files/tests/FileUploadForm.test.tsx Prefixed unused mock parameters with underscore

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

process.env.NODE_ENV = originalEnv;
// Restore original NODE_ENV
if (originalNodeEnv) {
Object.defineProperty(process.env, 'NODE_ENV', originalNodeEnv);

Copilot AI Nov 18, 2025

Copy link

Choose a reason for hiding this comment

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

The restoration logic for NODE_ENV is incomplete. If originalNodeEnv is undefined, the property should be deleted instead of left in the modified state. Add an else clause to delete the property when originalNodeEnv is undefined.

Suggested change
Object.defineProperty(process.env, 'NODE_ENV', originalNodeEnv);
Object.defineProperty(process.env, 'NODE_ENV', originalNodeEnv);
} else {
delete process.env.NODE_ENV;

Copilot uses AI. Check for mistakes.
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