Skip to content

Getting a random hash for FocusRing in snaphots #2938

Closed
@dermyhughes

Description

@dermyhughes

🐛 Bug Report

I am using the FocusRing component to wrap around a button like so:

import { FocusRing } from '@react-aria/focus';

<FocusRing focusRingClass={`foo`}>
      <button
        {...props}
      >
        {children}
      </button>
    </FocusRing>

But recently our Jest snapshots tests have been rendering these with a random hashed string rather than the element name.

🤔 Expected Behavior

Previously these tests rendered the component name, just like the DOM:

<FocusRing focusRingClass=\\"foo\\" >
    // Button element
</FocusRing>

😯 Current Behavior

<$dfd8c70b928eb1b3$export$1a38b4ad7f578e1d
  focusRingClass=\\"foo\\" >
    // Button element
</$dfd8c70b928eb1b3$export$1a38b4ad7f578e1d>

Is this expected or has something changed?

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