Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
19dc14af
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
19dc14af
编写于
3月 09, 2019
作者:
Z
zy410419243
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: abstract common method for comparison
上级
cfe531a5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
22 deletion
+12
-22
components/calendar/__tests__/index.test.js
components/calendar/__tests__/index.test.js
+12
-22
未找到文件。
components/calendar/__tests__/index.test.js
浏览文件 @
19dc14af
...
...
@@ -176,11 +176,8 @@ describe('Calendar', () => {
expect
(
onPanelChange
).
toBeCalled
();
expect
(
onPanelChange
.
mock
.
calls
[
0
][
1
]).
toEqual
(
'
year
'
);
});
it
(
'
if value.month > end.month, value.month -> end.month
'
,
()
=>
{
const
value
=
new
Moment
(
'
1990-01-03
'
);
const
start
=
new
Moment
(
'
2019-01-01
'
);
const
end
=
new
Moment
(
'
2019-03-01
'
);
const
onValueChange
=
jest
.
fn
();
const
createWrapper
=
(
start
,
end
,
value
,
onValueChange
)
=>
{
const
wrapper
=
mount
(
<
Header
onValueChange
=
{
onValueChange
}
...
...
@@ -197,7 +194,15 @@ describe('Calendar', () => {
.
find
(
'
.ant-select-dropdown-menu-item
'
)
.
at
(
0
)
.
simulate
(
'
click
'
);
expect
(
onValueChange
).
toHaveBeenCalledWith
(
value
.
year
(
'
2019
'
));
};
it
(
'
if value.month > end.month, value.month -> end.month
'
,
()
=>
{
const
value
=
new
Moment
(
'
1990-01-03
'
);
const
start
=
new
Moment
(
'
2019-04-01
'
);
const
end
=
new
Moment
(
'
2019-11-01
'
);
const
onValueChange
=
jest
.
fn
();
createWrapper
(
start
,
end
,
value
,
onValueChange
);
expect
(
onValueChange
).
toHaveBeenCalledWith
(
value
.
year
(
'
2019
'
).
month
(
'
3
'
));
});
it
(
'
if start.month > value.month, value.month -> start.month
'
,
()
=>
{
...
...
@@ -205,22 +210,7 @@ describe('Calendar', () => {
const
start
=
new
Moment
(
'
2019-11-01
'
);
const
end
=
new
Moment
(
'
2019-03-01
'
);
const
onValueChange
=
jest
.
fn
();
const
wrapper
=
mount
(
<
Header
onValueChange
=
{
onValueChange
}
value
=
{
value
}
validRange
=
{[
start
,
end
]}
locale
=
{{
year
:
'
年
'
}}
/>
,
);
wrapper
.
find
(
'
.ant-fullcalendar-year-select
'
)
.
hostNodes
()
.
simulate
(
'
click
'
);
wrapper
.
find
(
'
.ant-select-dropdown-menu-item
'
)
.
at
(
0
)
.
simulate
(
'
click
'
);
createWrapper
(
start
,
end
,
value
,
onValueChange
);
expect
(
onValueChange
).
toHaveBeenCalledWith
(
value
.
year
(
'
2019
'
).
month
(
'
10
'
));
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录