Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
a94e3ab3
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,发现更多精彩内容 >>
提交
a94e3ab3
编写于
8月 27, 2017
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add test case for empty table
上级
6527f9cd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
590 addition
and
0 deletion
+590
-0
components/table/__tests__/__snapshots__/empty.test.js.snap
components/table/__tests__/__snapshots__/empty.test.js.snap
+529
-0
components/table/__tests__/empty.test.js
components/table/__tests__/empty.test.js
+61
-0
未找到文件。
components/table/__tests__/__snapshots__/empty.test.js.snap
0 → 100644
浏览文件 @
a94e3ab3
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Table renders empty table 1`] = `
<div
class="ant-table-wrapper"
>
<div
class="ant-spin-nested-loading"
>
<div
class="ant-spin-container"
>
<div
class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left"
>
<div
class="ant-table-content"
>
<div
class="ant-table-body"
>
<table
class=""
>
<colgroup>
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col />
</colgroup>
<thead
class="ant-table-thead"
>
<tr>
<th
class=""
>
<span>
Column 1
</span>
</th>
<th
class=""
>
<span>
Column 2
</span>
</th>
<th
class=""
>
<span>
Column 3
</span>
</th>
<th
class=""
>
<span>
Column 4
</span>
</th>
<th
class=""
>
<span>
Column 5
</span>
</th>
<th
class=""
>
<span>
Column 6
</span>
</th>
<th
class=""
>
<span>
Column 7
</span>
</th>
<th
class=""
>
<span>
Column 8
</span>
</th>
</tr>
</thead>
<tbody
class="ant-table-tbody"
/>
</table>
</div>
<div
class="ant-table-placeholder"
>
<span>
<i
class="anticon anticon-frown-o"
/>
暂无数据
</span>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Table renders empty table with custom emptyText 1`] = `
<div
class="ant-table-wrapper"
>
<div
class="ant-spin-nested-loading"
>
<div
class="ant-spin-container"
>
<div
class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left"
>
<div
class="ant-table-content"
>
<div
class="ant-table-body"
>
<table
class=""
>
<colgroup>
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col />
</colgroup>
<thead
class="ant-table-thead"
>
<tr>
<th
class=""
>
<span>
Column 1
</span>
</th>
<th
class=""
>
<span>
Column 2
</span>
</th>
<th
class=""
>
<span>
Column 3
</span>
</th>
<th
class=""
>
<span>
Column 4
</span>
</th>
<th
class=""
>
<span>
Column 5
</span>
</th>
<th
class=""
>
<span>
Column 6
</span>
</th>
<th
class=""
>
<span>
Column 7
</span>
</th>
<th
class=""
>
<span>
Column 8
</span>
</th>
</tr>
</thead>
<tbody
class="ant-table-tbody"
/>
</table>
</div>
<div
class="ant-table-placeholder"
>
custom empty text
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Table renders empty table with fixed columns 1`] = `
<div
class="ant-table-wrapper"
>
<div
class="ant-spin-nested-loading"
>
<div
class="ant-spin-container"
>
<div
class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left"
>
<div
class="ant-table-content"
>
<div
class="ant-table-scroll"
>
<div
class="ant-table-body"
>
<table
class=""
>
<colgroup>
<col
style="width:100px;min-width:100px;"
/>
<col
style="width:100px;min-width:100px;"
/>
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col
style="width:100px;min-width:100px;"
/>
</colgroup>
<thead
class="ant-table-thead"
>
<tr>
<th
class=""
>
<span>
Full Name
</span>
</th>
<th
class=""
>
<span>
Age
</span>
</th>
<th
class=""
>
<span>
Column 1
</span>
</th>
<th
class=""
>
<span>
Column 2
</span>
</th>
<th
class=""
>
<span>
Column 3
</span>
</th>
<th
class=""
>
<span>
Column 4
</span>
</th>
<th
class=""
>
<span>
Column 5
</span>
</th>
<th
class=""
>
<span>
Column 6
</span>
</th>
<th
class=""
>
<span>
Column 7
</span>
</th>
<th
class=""
>
<span>
Column 8
</span>
</th>
<th
class=""
>
<span>
Action
</span>
</th>
</tr>
</thead>
<tbody
class="ant-table-tbody"
>
<tr
class="ant-table-row ant-table-row-level-0"
>
<td
class=""
>
<span
class="ant-table-row-indent indent-level-0"
style="padding-left:0px;"
/>
</td>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
<td
class=""
/>
</tr>
</tbody>
</table>
</div>
<div
class="ant-table-placeholder ant-table-placeholder-fixed-columns"
>
<span>
<i
class="anticon anticon-frown-o"
/>
暂无数据
</span>
</div>
</div>
<div
class="ant-table-fixed-left"
>
<div
class="ant-table-body-outer"
>
<div
class="ant-table-body-inner"
>
<table
class="ant-table-fixed"
>
<colgroup>
<col
style="width:100px;min-width:100px;"
/>
<col
style="width:100px;min-width:100px;"
/>
</colgroup>
<thead
class="ant-table-thead"
>
<tr>
<th
class=""
>
<span>
Full Name
</span>
</th>
<th
class=""
>
<span>
Age
</span>
</th>
</tr>
</thead>
<tbody
class="ant-table-tbody"
>
<tr
class="ant-table-row ant-table-row-level-0"
>
<td
class=""
>
<span
class="ant-table-row-indent indent-level-0"
style="padding-left:0px;"
/>
</td>
<td
class=""
/>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div
class="ant-table-fixed-right"
>
<div
class="ant-table-body-outer"
>
<div
class="ant-table-body-inner"
>
<table
class="ant-table-fixed"
>
<colgroup>
<col
style="width:100px;min-width:100px;"
/>
</colgroup>
<thead
class="ant-table-thead"
>
<tr>
<th
class=""
>
<span>
Action
</span>
</th>
</tr>
</thead>
<tbody
class="ant-table-tbody"
>
<tr
class="ant-table-row ant-table-row-level-0"
>
<td
class=""
/>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
components/table/__tests__/empty.test.js
0 → 100644
浏览文件 @
a94e3ab3
import
React
from
'
react
'
;
import
{
render
}
from
'
enzyme
'
;
import
Table
from
'
..
'
;
const
columns
=
[
{
title
:
'
Column 1
'
,
dataIndex
:
'
address
'
,
key
:
'
1
'
},
{
title
:
'
Column 2
'
,
dataIndex
:
'
address
'
,
key
:
'
2
'
},
{
title
:
'
Column 3
'
,
dataIndex
:
'
address
'
,
key
:
'
3
'
},
{
title
:
'
Column 4
'
,
dataIndex
:
'
address
'
,
key
:
'
4
'
},
{
title
:
'
Column 5
'
,
dataIndex
:
'
address
'
,
key
:
'
5
'
},
{
title
:
'
Column 6
'
,
dataIndex
:
'
address
'
,
key
:
'
6
'
},
{
title
:
'
Column 7
'
,
dataIndex
:
'
address
'
,
key
:
'
7
'
},
{
title
:
'
Column 8
'
,
dataIndex
:
'
address
'
,
key
:
'
8
'
},
];
const
columnsFixed
=
[
{
title
:
'
Full Name
'
,
width
:
100
,
dataIndex
:
'
name
'
,
key
:
'
name
'
,
fixed
:
'
left
'
},
{
title
:
'
Age
'
,
width
:
100
,
dataIndex
:
'
age
'
,
key
:
'
age
'
,
fixed
:
'
left
'
},
{
title
:
'
Column 1
'
,
dataIndex
:
'
address
'
,
key
:
'
1
'
},
{
title
:
'
Column 2
'
,
dataIndex
:
'
address
'
,
key
:
'
2
'
},
{
title
:
'
Column 3
'
,
dataIndex
:
'
address
'
,
key
:
'
3
'
},
{
title
:
'
Column 4
'
,
dataIndex
:
'
address
'
,
key
:
'
4
'
},
{
title
:
'
Column 5
'
,
dataIndex
:
'
address
'
,
key
:
'
5
'
},
{
title
:
'
Column 6
'
,
dataIndex
:
'
address
'
,
key
:
'
6
'
},
{
title
:
'
Column 7
'
,
dataIndex
:
'
address
'
,
key
:
'
7
'
},
{
title
:
'
Column 8
'
,
dataIndex
:
'
address
'
,
key
:
'
8
'
},
{
title
:
'
Action
'
,
key
:
'
address
'
,
fixed
:
'
right
'
,
width
:
100
,
},
];
describe
(
'
Table
'
,
()
=>
{
it
(
'
renders empty table
'
,
()
=>
{
const
wrapper
=
render
(
<
Table
dataSource
=
{[]}
columns
=
{
columns
}
pagination
=
{
false
}
/
>
);
expect
(
wrapper
).
toMatchSnapshot
();
});
it
(
'
renders empty table with fixed columns
'
,
()
=>
{
const
wrapper
=
render
(
<
Table
dataSource
=
{[]}
columns
=
{
columnsFixed
}
pagination
=
{
false
}
/
>
);
expect
(
wrapper
).
toMatchSnapshot
();
});
it
(
'
renders empty table with custom emptyText
'
,
()
=>
{
const
wrapper
=
render
(
<
Table
dataSource
=
{[]}
columns
=
{
columns
}
pagination
=
{
false
}
locale
=
{{
emptyText
:
'
custom empty text
'
}}
/
>
);
expect
(
wrapper
).
toMatchSnapshot
();
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录