mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
test: Back of test coverage (#24418)
* test: Back of test coverage * move rtl test out
This commit is contained in:
parent
03e6b33681
commit
faa75d592c
@ -0,0 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Collapse rtl render component should be rendered correctly in RTL direction 1`] = `
|
||||
<div
|
||||
class="ant-collapse ant-collapse-icon-position-right ant-collapse-rtl"
|
||||
/>
|
||||
`;
|
@ -49,12 +49,6 @@ exports[`Collapse could override default openAnimation 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Collapse rtl render component should be rendered correctly in RTL direction 1`] = `
|
||||
<div
|
||||
class="ant-collapse ant-collapse-icon-position-right ant-collapse-rtl"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`Collapse should render extra node of panel 1`] = `
|
||||
<div
|
||||
class="ant-collapse ant-collapse-icon-position-left"
|
||||
|
8
components/collapse/__tests__/common.test.js
Normal file
8
components/collapse/__tests__/common.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import Collapse from '..';
|
||||
|
||||
describe('Collapse', () => {
|
||||
mountTest(Collapse);
|
||||
rtlTest(Collapse);
|
||||
});
|
@ -1,7 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
|
||||
describe('Collapse', () => {
|
||||
@ -18,8 +16,6 @@ describe('Collapse', () => {
|
||||
|
||||
// eslint-disable-next-line global-require
|
||||
const Collapse = require('..').default;
|
||||
mountTest(Collapse);
|
||||
rtlTest(Collapse);
|
||||
|
||||
it('should support remove expandIcon', () => {
|
||||
const wrapper = mount(
|
||||
@ -65,11 +61,10 @@ describe('Collapse', () => {
|
||||
</Collapse>,
|
||||
);
|
||||
expect(wrapper.find('.ant-collapse-item').hasClass('ant-collapse-item-active')).toBe(false);
|
||||
wrapper
|
||||
.find('.ant-collapse-header')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
wrapper.find('.ant-collapse-header').at(0).simulate('click');
|
||||
wrapper.update();
|
||||
await sleep(400);
|
||||
wrapper.update();
|
||||
expect(wrapper.find('.ant-collapse-item').hasClass('ant-collapse-item-active')).toBe(true);
|
||||
});
|
||||
|
||||
@ -81,10 +76,7 @@ describe('Collapse', () => {
|
||||
</Collapse.Panel>
|
||||
</Collapse>,
|
||||
);
|
||||
wrapper
|
||||
.find('.ant-collapse-header')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
wrapper.find('.ant-collapse-header').at(0).simulate('click');
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user