fix(@vben/common-ui): text omission component expansion exception (#4139)
* fix(@vben/common-ui): 修复文本省略组件展开异常 * chore: 增加点击展开切换的测试
This commit is contained in:
@@ -31,9 +31,16 @@ describe('ellipsis-text.vue', () => {
|
||||
default: 'This is a very long text that should be truncated.',
|
||||
},
|
||||
});
|
||||
|
||||
const ellipsis = wrapper.find('.truncate');
|
||||
|
||||
// 点击 ellipsis,应该触发 expandChange,参数为 false
|
||||
await ellipsis.trigger('click');
|
||||
expect(wrapper.emitted('expandChange')).toBeTruthy();
|
||||
expect(wrapper.emitted('expandChange')?.[0]).toEqual([true]);
|
||||
|
||||
// 再次点击,应该触发 expandChange,参数为 false
|
||||
await ellipsis.trigger('click');
|
||||
expect(wrapper.emitted('expandChange')?.length).toBe(2);
|
||||
expect(wrapper.emitted('expandChange')?.[1]).toEqual([false]);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user