feat(CellGroup): add title slot (#4227)
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`CellGroup title slot 1`] = `
|
||||
<div>
|
||||
<div class="van-cell-group__title">CustomTitle</div>
|
||||
<div class="van-cell-group van-hairline--top-bottom"></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`arrow direction 1`] = `
|
||||
<div class="van-cell van-cell--clickable"><i class="van-icon van-icon-arrow-down van-cell__right-icon">
|
||||
<!----></i></div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Cell from '..';
|
||||
import CellGroup from '../../cell-group';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('click event', () => {
|
||||
@@ -56,3 +57,13 @@ test('title-style prop', () => {
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('CellGroup title slot', () => {
|
||||
const wrapper = mount(CellGroup, {
|
||||
scopedSlots: {
|
||||
title: () => 'CustomTitle'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user