Skip to content

[REGRESSION]: Wrong enum value when imported from another file #29302

@ritz078

Description

@ritz078

I am doing react component testing

Context:

  • GOOD Playwright Version: 1.41.0
  • BAD Playwright Version: 1.41.2
  • Operating System: [e.g. Windows, Linux or Mac]: Mac
  • Extra: [any specific details about your environment]

Code Snippet

// CreateSignature.types.ts

 export enum ALLOWED_TABS {
  DRAW = "DRAW",
  TYPE = "TYPE",
  IMAGE = "IMAGE",
}
// x.spec.tsx
import { ALLOWED_TABS } from "../CreateSignature.types";

console.log(ALLOWED_TABS);

// This gives
// {
//  __pw_type: 'importRef',
//  id: 'recipes_src_components_CreateSignature_CreateSignature_types_ts_ALLOWED_TABS'
// }

When we define ALLOWED_TABS in other file and import it,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions