Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
49546c93
Commit
49546c93
authored
Oct 20, 2016
by
qingwei.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Card: add test
parent
9e0afd38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
packages/card/src/main.vue
packages/card/src/main.vue
+1
-1
test/unit/specs/card.spec.js
test/unit/specs/card.spec.js
+30
-0
No files found.
packages/card/src/main.vue
View file @
49546c93
<
template
>
<div
class=
"el-card"
>
<div
class=
"el-card__header"
v-if=
"$slots.header"
>
<div
class=
"el-card__header"
v-if=
"$slots.header
|| header
"
>
<slot
name=
"header"
>
{{
header
}}
</slot>
</div>
<div
class=
"el-card__body"
:style=
"bodyStyle"
>
...
...
test/unit/specs/card.spec.js
0 → 100644
View file @
49546c93
import
{
createVue
,
createTest
}
from
'
../util
'
;
import
Card
from
'
packages/card
'
;
describe
(
'
Card
'
,
()
=>
{
it
(
'
slot:header
'
,
()
=>
{
const
vm
=
createVue
(
`
<el-card>
<header slot="header">二师兄叫我埋梗 啦啦啦</header>
</el-card>
`
);
expect
(
vm
.
$el
.
querySelector
(
'
.el-card__header
'
)).
to
.
property
(
'
textContent
'
).
to
.
include
(
'
二师兄叫我埋梗 啦啦啦
'
);
});
it
(
'
header
'
,
()
=>
{
const
vm
=
createTest
(
Card
,
{
header
:
'
好烦
'
});
expect
(
vm
.
$el
.
querySelector
(
'
.el-card__header
'
)).
to
.
property
(
'
textContent
'
).
to
.
include
(
'
好烦
'
);
});
it
(
'
bodyStyle
'
,
()
=>
{
const
vm
=
createTest
(
Card
,
{
bodyStyle
:
{
padding
:
'
10px
'
}
});
expect
(
vm
.
$el
.
querySelector
(
'
.el-card__body
'
).
style
.
padding
).
to
.
equal
(
'
10px
'
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment