Skip to content

Commit

Permalink
more test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti committed May 3, 2024
1 parent 0a87590 commit 9eda952
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import React from 'react'
import {render, screen} from '@testing-library/react'
import renderer from 'react-test-renderer'
import UnderlinePanels from './UnderlinePanels'
import {checkExports} from '../../utils/testing'
import {behavesAsComponent, checkExports} from '../../utils/testing'
import TabContainerElement from '@github/tab-container-element'

TabContainerElement.prototype.selectTab = jest.fn()
Expand All @@ -20,14 +19,19 @@ const UnderlinePanelsMockComponent = (props: {'aria-label'?: string; 'aria-label
</UnderlinePanels>
)

// const tree = renderer.create(<UnderlinePanelsMockComponent aria-label="Select a tab" />).toJSON()
// expect(tree).toMatchSnapshot()

describe('UnderlinePanels', () => {
afterEach(() => {
jest.restoreAllMocks()
})

checkExports('drafts/UnderlinePanels', {
default: UnderlinePanels,
})

behavesAsComponent({Component: UnderlinePanels, options: {skipAs: true}})

behavesAsComponent({Component: UnderlinePanels.Tab})

it('renders without errors', () => {
render(<UnderlinePanelsMockComponent aria-label="Select a tab" />)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const UnderlineTab = forwardRef(
forwardedRef,
) => {
return (
<StyledUnderlineTab ref={forwardedRef} as={as} {...rest}>
<StyledUnderlineTab ref={forwardedRef} as={as} sx={sxProp} {...rest}>
{iconsVisible && Icon && (
<span data-component="icon">
<Icon />
Expand Down

0 comments on commit 9eda952

Please sign in to comment.