@@ -3,6 +3,7 @@ import { render, fireEvent } from '@testing-library/react'
3
3
4
4
import { renderWithTheme , theme } from '../../../test/utils'
5
5
import { blockSizes } from '../common/system'
6
+ import { createDisabledTextStyles } from '../common'
6
7
7
8
import Button from './Button'
8
9
@@ -36,11 +37,21 @@ describe('<Button />', () => {
36
37
expect ( onButtonClick ) . toHaveBeenCalled ( )
37
38
} )
38
39
39
- it ( 'should render disabled' , ( ) => {
40
- const { getByRole } = renderWithTheme ( < Button { ...defaultProps } disabled /> )
40
+ it ( 'should handle disabled for all variants ' , ( ) => {
41
+ const { getByRole, rerender } = renderWithTheme ( < Button { ...defaultProps } disabled /> )
41
42
const button = getByRole ( 'button' )
43
+ const disabledTextShadow = `1px 1px ${ theme . textDisabledShadow } `
42
44
43
45
expect ( button ) . toHaveStyleRule ( 'color' , theme . textDisabled )
46
+ expect ( button ) . toHaveStyleRule ( 'text-shadow' , disabledTextShadow )
47
+
48
+ rerender ( < Button { ...defaultProps } variant = 'menu' /> )
49
+ expect ( button ) . toHaveStyleRule ( 'color' , theme . textDisabled )
50
+ expect ( button ) . toHaveStyleRule ( 'text-shadow' , disabledTextShadow )
51
+
52
+ rerender ( < Button { ...defaultProps } variant = 'flat' /> )
53
+ expect ( button ) . toHaveStyleRule ( 'color' , theme . textDisabled )
54
+ expect ( button ) . toHaveStyleRule ( 'text-shadow' , disabledTextShadow )
44
55
} )
45
56
46
57
it ( 'should handle fullWidth prop' , ( ) => {
0 commit comments