Skip to content

Commit

Permalink
Test elements accept className
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Oct 16, 2024
1 parent 2742ee5 commit 3069da5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react/src/utils/testing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ export function behavesAsComponent({Component, toRender, options}: BehavesAsComp
it('sets a valid displayName', () => {
expect(Component.displayName).toMatch(COMPONENT_DISPLAY_NAME_REGEX)
})

it('should support `className` on the outermost element', () => {
const elem = React.cloneElement(getElement(), {className: 'test-class-name'})
expect(rendersClass(elem, 'test-class-name')).toBe(true)
})
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 3069da5

Please sign in to comment.