Skip to content
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

bumping enzyme to latest version #1055

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

polatengin
Copy link
Collaborator

No description provided.

@polatengin polatengin self-assigned this Feb 27, 2025
@polatengin polatengin requested a review from Copilot April 3, 2025 16:33
Copy link

@Copilot Copilot AI left a comment

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 updates the tests for several frontend components to work with the latest version of Enzyme by adding "as any" type casts to shallow rendering.

  • Updated shallow render calls in tests by adding "as any" to bypass type errors.
  • Modified multiple test files to accommodate changes with the latest Enzyme version.

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/frontend/components/tests/workflowStage.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/noFeedbackBoardsView.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/feedbackItem.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/feedbackColumn.test.tsx Added "as any" cast to shallow render and matching element calls.
src/frontend/components/tests/feedbackCarousel.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/feedbackBoardMetadataFormPermissions.test.tsx Added "as any" cast to shallow and mount render calls.
src/frontend/components/tests/feedbackBoardMetadataForm.test.tsx Added "as any" cast to shallow render calls throughout.
src/frontend/components/tests/feedbackBoardContainer.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/editableText.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/editableDocumentCardTitle.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/boardSummary.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/actionItemDisplay.test.tsx Added "as any" cast to shallow render calls.
src/frontend/components/tests/actionItem.test.tsx Added "as any" cast to shallow render calls.
Files not reviewed (2)
  • src/frontend/package-lock.json: Language not supported
  • src/frontend/package.json: Language not supported
Comments suppressed due to low confidence (4)

src/frontend/components/tests/feedbackItem.test.tsx:35

  • [nitpick] The addition of 'as any' disables type validation which could mask component interface problems. Consider using correct typings to preserve type safety in test renders.
const wrapper = shallow(<FeedbackItem {...testProps} /> as any);

src/frontend/components/tests/feedbackCarousel.test.tsx:24

  • [nitpick] Adding 'as any' bypasses compile-time type checks. Consider upgrading the type definitions or adapter configuration so that the proper types are maintained.
const wrapper = shallow(<FeedbackCarousel {...mockedProps} /> as any);

src/frontend/components/tests/feedbackBoardMetadataFormPermissions.test.tsx:27

  • [nitpick] The usage of 'as any' suppresses type errors that could point to underlying issues. It is recommended to update the type definitions for FeedbackBoardMetadataFormPermissions or the enzyme adapter.
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...mockedProps} /> as any);

src/frontend/components/tests/editableDocumentCardTitle.test.tsx:18

  • [nitpick] Using 'as any' here suppresses TypeScript's type checks. Consider updating component or adapter types to avoid bypassing type safety.
const wrapper = shallow(<EditableDocumentCardTitle {...mockedProps} /> as any);

@polatengin
Copy link
Collaborator Author

@dependabot rebase

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