mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[Improvement] Collapse: add transition animation (#1500)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Collapse from '..';
|
||||
import CollapseItem from '../../collapse-item';
|
||||
import { mount } from '../../../test/utils';
|
||||
import { later, mount } from '../../../test/utils';
|
||||
|
||||
const component = {
|
||||
template: `
|
||||
@@ -24,7 +24,7 @@ const component = {
|
||||
}
|
||||
};
|
||||
|
||||
test('basic mode', () => {
|
||||
test('basic mode', async() => {
|
||||
const wrapper = mount(component);
|
||||
|
||||
const titles = wrapper.findAll('.van-collapse-item__title');
|
||||
@@ -34,13 +34,14 @@ test('basic mode', () => {
|
||||
titles.at(1).trigger('click');
|
||||
expect(wrapper.vm.active).toEqual(['first', 1]);
|
||||
|
||||
await later();
|
||||
titles.at(0).trigger('click');
|
||||
expect(wrapper.vm.active).toEqual([1]);
|
||||
|
||||
wrapper.destroy();
|
||||
});
|
||||
|
||||
it('accordion', () => {
|
||||
it('accordion', async() => {
|
||||
const wrapper = mount(component, {
|
||||
propsData: {
|
||||
accordion: true
|
||||
@@ -54,6 +55,7 @@ it('accordion', () => {
|
||||
titles.at(1).trigger('click');
|
||||
expect(wrapper.vm.active).toEqual(1);
|
||||
|
||||
await later();
|
||||
titles.at(0).trigger('click');
|
||||
expect(wrapper.vm.active).toEqual('first');
|
||||
|
||||
|
Reference in New Issue
Block a user