-
-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Checkbox): fix Checkbox not clickable in Firefox (#3728)
* fix(Checkbox): fix Checkbox not clickable in Firefox * test: update CheckPickerSpec.tsx * test: update CheckPickerSpec.tsx
- Loading branch information
Showing
4 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import Checkbox from '../Checkbox'; | ||
import { toRGB, itChrome } from '@test/utils'; | ||
|
||
import '../styles/index.less'; | ||
|
||
describe('Checkbox styles', () => { | ||
itChrome('Should render the correct border', () => { | ||
const instanceRef = React.createRef<HTMLDivElement>(); | ||
render(<Checkbox ref={instanceRef} />); | ||
render(<Checkbox />); | ||
|
||
const innerDom = instanceRef.current?.querySelector('.rs-checkbox-inner') as HTMLElement; | ||
assert.equal( | ||
window.getComputedStyle(innerDom, '::before').border, | ||
const inner = screen.getByTestId('checkbox-control-inner'); | ||
expect(window.getComputedStyle(inner, '::before').border).to.equal( | ||
`1px solid ${toRGB('#d9d9d9')}` | ||
); | ||
}); | ||
|
||
it('Should render the correct size', () => { | ||
render(<Checkbox />); | ||
|
||
expect(screen.getByRole('checkbox')).to.have.style('width', '36px'); | ||
expect(screen.getByRole('checkbox')).to.have.style('height', '36px'); | ||
}); | ||
}); |