mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
test: Add jest-enzyme assertion library for better frontend tests (#10459)
* adding jest-enzyme * enzymeify lots of assertions * types for jest-enzyme
This commit is contained in:
committed by
GitHub
parent
671461d0d0
commit
7f70a241f9
@@ -40,7 +40,7 @@ describe('Checkbox', () => {
|
||||
expect(React.isValidElement(<Checkbox {...defaultProps} />)).toBe(true);
|
||||
});
|
||||
it('inits checked when checked', () => {
|
||||
expect(wrapper.find('i.fa-check.text-primary')).toHaveLength(1);
|
||||
expect(wrapper.find('i.fa-check.text-primary')).toExist();
|
||||
});
|
||||
it('inits unchecked when not checked', () => {
|
||||
const el = factory({ checked: false });
|
||||
@@ -48,7 +48,7 @@ describe('Checkbox', () => {
|
||||
expect(el.find('i.fa-check.text-transparent')).toHaveLength(1);
|
||||
});
|
||||
it('unchecks when clicked', () => {
|
||||
expect(wrapper.find('i.fa-check.text-transparent')).toHaveLength(0);
|
||||
expect(wrapper.find('i.fa-check.text-transparent')).not.toExist();
|
||||
wrapper.find('i').first().simulate('click');
|
||||
expect(defaultProps.onChange.calledOnce).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user