Skip to content

[Bug]: Component fails to render in test when importing/using a variable from the same file as the component. #29504

Open
@CkSned

Description

@CkSned

Version

1.41.2

Steps to reproduce

  1. Download the attached minimal reproduction zip file.
  2. Install dependencies with pnpm install.
  3. Run the tests with pnpm test (should pass).
  4. Uncomment the console.log(links); line in the test.
  5. Run the tests again.

ct-import-bug.zip

Expected behavior

When component testing, we should be able to import & use a variable from the same file as the component currently under test.

Actual behavior

The component fails to render in test when importing/using a variable from the same file as the component.

Additional context

No response

Environment

System:
    OS: macOS 14.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.21 GB / 16.00 GB
  Binaries:
    Node: 18.18.2 - ~/.asdf/installs/nodejs/18.18.2/bin/node
    npm: 10.2.5 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.15.2 - /opt/homebrew/bin/pnpm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/experimental-ct-react: 1.41.2 => 1.41.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions