mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
test: update test
This commit is contained in:
parent
248dfbb6f6
commit
307c1fc093
@ -3,6 +3,7 @@ import { mount } from '@vue/test-utils';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { ref } from 'vue';
|
||||
|
||||
describe('Switch', () => {
|
||||
focusTest(Switch);
|
||||
@ -10,8 +11,16 @@ describe('Switch', () => {
|
||||
|
||||
it('should has click wave effect', async () => {
|
||||
const wrapper = mount({
|
||||
render() {
|
||||
return <Switch />;
|
||||
setup() {
|
||||
const checked = ref(false);
|
||||
return () => {
|
||||
return (
|
||||
<Switch
|
||||
checked={checked.value}
|
||||
onChange={() => (checked.value = !checked.value)}
|
||||
></Switch>
|
||||
);
|
||||
};
|
||||
},
|
||||
});
|
||||
wrapper.find('.ant-switch').trigger('click');
|
||||
|
@ -253,7 +253,7 @@ describe('Typography', () => {
|
||||
|
||||
describe('editable', async () => {
|
||||
function testStep(name, submitFunc, expectFunc) {
|
||||
it(name, async () => {
|
||||
fit(name, async () => {
|
||||
const onStart = jest.fn();
|
||||
const onChange = jest.fn();
|
||||
|
||||
@ -286,7 +286,7 @@ describe('Typography', () => {
|
||||
|
||||
await sleep(20);
|
||||
wrapper.find('textarea').element.value = 'Bamboo';
|
||||
wrapper.find('textarea').trigger('change');
|
||||
//wrapper.find('textarea').trigger('change');
|
||||
|
||||
if (submitFunc) {
|
||||
submitFunc(wrapper);
|
||||
|
Loading…
Reference in New Issue
Block a user