Skip to content

Commit

Permalink
test(Cell): add test cases (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccccpj authored Jun 9, 2023
1 parent f930245 commit fc4bab2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cell/__test__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { mount } from '@vue/test-utils';
import { describe, it, expect } from 'vitest';
import { ChevronRightIcon, AppIcon } from 'tdesign-icons-vue-next';
import Cell from '../cell.vue';
import CellGroup from '../cell-group.vue';
import Avatar from '../../avatar/avatar.vue';
import { TdCellProps } from '../type';

const appIcon = () => h(AppIcon);
const chevronRightIcon = () => h(ChevronRightIcon);
const alignList = ['bottom', 'middle', 'top'];
const themeList = ['default', 'card'];
const avatarUrl = 'https://tdesign.gtimg.com/mobile/demos/avatar_1.png';

describe('Cell.vue', async () => {
Expand Down Expand Up @@ -96,3 +97,12 @@ describe('Cell.vue', async () => {
expect(wrapper.emitted('click')).toBeDefined();
});
});
describe('cell-group', async () => {
it(': theme', async () => {
themeList.forEach((t) => {
const wrapper = mount(() => <CellGroup theme={t}></CellGroup>);
const theme = wrapper.find(`.t-cell-group--${t}`);
expect(theme.exists()).toBeTruthy();
});
});
});

0 comments on commit fc4bab2

Please sign in to comment.