Skip to content

Bug: Type errors in PostCard.spec.tsx due to duplicate/conflicting InterfacePostCard definitions #6243

@nilanjan-sikdar

Description

@nilanjan-sikdar

Describe the bug
The pnpm typecheck command fails with errors in src/sharedcomponents/postCard/PostCard.spec.tsx.
The test attempts to render PostCard with video and image props, but the TypeScript compiler reports that these properties do not exist on Partial.

This appears to be caused by a duplicate definition of InterfacePostCard:

  1. src/utils/interfaces.ts: Defines InterfacePostCard without image and video properties.
  2. src/types/Post/interface.ts: Defines InterfacePostCard with image and video properties.

The test file is likely complying with the definition from src/utils/interfaces.ts, causing the mismatch.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout the current branch.
  2. Run pnpm install.
  3. Run pnpm typecheck.

Expected behavior
The type check should pass, and the PostCard interface should be consistent across the application to support the video and image props used in tests/components.

Actual behavior

Image

Screenshots
If applicable, add screenshots to help explain your problem.

Additional details
Conflicting Definitions:

  1. src/utils/interfaces.ts (Lines ~2271)
  2. src/types/Post/interface.ts (Lines ~3)

The codebase should ideally be refactored to use a single source of truth for InterfacePostCard.

Metadata

Metadata

Labels

bugSomething isn't workingduplicateThis issue or pull request already existsgood first issueGood for newcomers

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions