1 | import React from 'react';
|
2 | import {shallow, mount, render} from 'enzyme';
|
3 | import {expect} from 'chai';
|
4 | import Cascader from '../src/index';
|
5 | const options = [
|
6 | {
|
7 | value: '浙江',
|
8 | children: [
|
9 | {
|
10 | value: '杭州',
|
11 | children: [
|
12 | {
|
13 | value: '西湖',
|
14 | children: [
|
15 | {
|
16 | value: '白娘子'
|
17 | },
|
18 | {
|
19 | value: '许仙'
|
20 | }]
|
21 | }]
|
22 | }
|
23 | ]
|
24 | },
|
25 | {
|
26 | value: '江苏',
|
27 | children: [
|
28 | {
|
29 | value: '南京',
|
30 | children: [
|
31 | {
|
32 | value: '中华门'
|
33 | }]
|
34 | }
|
35 | ]
|
36 | },
|
37 | {
|
38 | value: '山东'
|
39 | }
|
40 | ];
|
41 | describe('是否打开cascader',function(){
|
42 | it('弹出面板',function(){
|
43 | let mCascader = mount(<Cascader options = {options} />);
|
44 | expect(mCascader.find('div').at(0).hasClass('cascader-container')).to.equal(true)
|
45 | })
|
46 | }) |
\ | No newline at end of file |