Skip to content

Commit

Permalink
test(tree): tree 组件完善测试用例说明
Browse files Browse the repository at this point in the history
  • Loading branch information
TabSpace committed Sep 18, 2021
1 parent ebe7ed6 commit 3d2d8ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/unit/tree/tree-append.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { wait } from './kit';

describe('tree', () => {
describe('tree:append', () => {
it('TreeStore.append get multi nodes', async () => {
it('append 方法添加多个节点', async () => {
const tree = new TreeStore();
tree.append([{}, {}]);
await wait(1);
Expand Down
4 changes: 2 additions & 2 deletions test/unit/tree/tree-checked.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { wait } from './kit';

describe('tree', () => {
describe('tree:checked', () => {
it('TreeNode.setChecked changed checked property', async () => {
it('setChecked 方法可以修改选中属性', async () => {
const tree = new TreeStore({
checkable: true,
});
Expand All @@ -27,7 +27,7 @@ describe('tree', () => {

// 手动测试中发现,选中节点意外影响了节点的高亮状态
// 添加此测试排除模型出错的可能性
it('TreeNode.setChecked will not access other property', async () => {
it('setChecked 方法不会影响其他属性', async () => {
const tree = new TreeStore({
checkable: true,
});
Expand Down
6 changes: 3 additions & 3 deletions test/unit/tree/tree-init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import TreeNode from '../../../js/tree/tree-node';

describe('tree', () => {
describe('tree:init', () => {
it('TreeStore init empty tree', () => {
it('TreeStore 初始化空数据', () => {
const tree = new TreeStore();
expect(typeof tree).toBe('object');
expect(typeof tree.config).toBe('object');
});

it('TreeNode init empty node', () => {
it('TreeNode 初始化空节点', () => {
const tree = new TreeStore();
const node = new TreeNode(tree, {});
expect(typeof node).toBe('object');
expect(typeof node.value).toBe('string');
});

it('TreeNode init tree data', () => {
it('TreeNode 初始化正常数据', () => {
const tree = new TreeStore();
const node = new TreeNode(tree, {
value: '1',
Expand Down

0 comments on commit 3d2d8ec

Please sign in to comment.