Skip to content

Automated Testing: Unskip tests blocked by Enzyme support of React 16.3 #7005

@aduth

Description

@aduth

Previously: https://github.com/WordPress/gutenberg/pull/6527/files#r185974677

We currently skip tests which rely on React.forwardRef because they are not supported yet by Enzyme:

// Disable reason: This test is desirable, but unsupported by Enzyme in
// the current version, as it depends on features new to React in 16.3.0.
//
// eslint-disable-next-line jest/no-disabled-tests
describe.skip( 'ref forwarding', () => {
it( 'should enable access to DOM element', () => {
const ref = createRef();
mount( <ButtonWithForwardedRef ref={ ref } /> );
expect( ref.current.nodeName ).toBe( 'button' );
} );
} );

This is tracked by the Enzyme project at enzymejs/enzyme#1604

Once the above issue is closed and Enzyme produces a new release introducing support for React.forwardRef, we should remove the workarounds introduced by #6527 .

Open questions:

  • What else do we use from React 16.3 that isn't supported by Enzyme that will need to be updated?
  • What components other than Button have tests which need to be updated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] TaskIssues or PRs that have been broken down into an individual action to take

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions