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
815bdd47
Commit
815bdd47
authored
Oct 18, 2016
by
cinwell.li
Committed by
FuryBean
Oct 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tooltip: add test (#487)
parent
7175ad27
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
+52
-2
build/bin/build-entry.js
build/bin/build-entry.js
+2
-1
src/index.js
src/index.js
+2
-1
test/unit/specs/tooltip.spec.js
test/unit/specs/tooltip.spec.js
+48
-0
No files found.
build/bin/build-entry.js
View file @
815bdd47
...
@@ -10,6 +10,7 @@ var INSTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
...
@@ -10,6 +10,7 @@ var INSTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
var
MAIN_TEMPLATE
=
`{{include}}
var
MAIN_TEMPLATE
=
`{{include}}
const install = function(Vue) {
const install = function(Vue) {
/* istanbul ignore if */
if (install.installed) return;
if (install.installed) return;
{{install}}
{{install}}
...
@@ -24,7 +25,7 @@ const install = function(Vue) {
...
@@ -24,7 +25,7 @@ const install = function(Vue) {
Vue.prototype.$message = Message;
Vue.prototype.$message = Message;
};
};
/
/ auto install
/
* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
install(window.Vue);
};
};
...
...
src/index.js
View file @
815bdd47
...
@@ -55,6 +55,7 @@ import Steps from '../packages/steps/index.js';
...
@@ -55,6 +55,7 @@ import Steps from '../packages/steps/index.js';
import
Step
from
'
../packages/step/index.js
'
;
import
Step
from
'
../packages/step/index.js
'
;
const
install
=
function
(
Vue
)
{
const
install
=
function
(
Vue
)
{
/* istanbul ignore next */
if
(
install
.
installed
)
return
;
if
(
install
.
installed
)
return
;
Vue
.
component
(
Pagination
.
name
,
Pagination
);
Vue
.
component
(
Pagination
.
name
,
Pagination
);
...
@@ -119,7 +120,7 @@ const install = function(Vue) {
...
@@ -119,7 +120,7 @@ const install = function(Vue) {
Vue
.
prototype
.
$message
=
Message
;
Vue
.
prototype
.
$message
=
Message
;
};
};
/
/ auto install
/
* istanbul ignore next */
if
(
typeof
window
!==
'
undefined
'
&&
window
.
Vue
)
{
if
(
typeof
window
!==
'
undefined
'
&&
window
.
Vue
)
{
install
(
window
.
Vue
);
install
(
window
.
Vue
);
};
};
...
...
test/unit/specs/tooltip.spec.js
0 → 100644
View file @
815bdd47
import
{
createVue
}
from
'
../util
'
;
describe
(
'
Tooltip
'
,
()
=>
{
it
(
'
create
'
,
()
=>
{
const
vm
=
createVue
(
`
<el-tooltip content="提示文字">
<button>click</button>
</el-tooltip>`
);
expect
(
vm
.
$el
.
querySelector
(
'
.el-tooltip__popper
'
)).
to
.
exist
;
expect
(
vm
.
$el
.
querySelector
(
'
.el-tooltip__popper
'
).
textContent
).
to
.
equal
(
'
提示文字
'
);
});
it
(
'
hover
'
,
done
=>
{
const
vm
=
createVue
(
`
<el-tooltip ref="tooltip" content="提示文字">
<button>click</button>
</el-tooltip>
`
,
true
);
const
tooltip
=
vm
.
$refs
.
tooltip
;
// trigger mouseenter
tooltip
.
handleShowPopper
();
expect
(
tooltip
.
popperElm
).
to
.
not
.
exist
;
setTimeout
(
_
=>
{
expect
(
tooltip
.
popperElm
).
to
.
exist
;
expect
(
tooltip
.
popperElm
.
style
.
display
).
to
.
not
.
equal
(
'
none
'
);
// trigger mouseleave
tooltip
.
handleClosePopper
();
setTimeout
(
_
=>
{
expect
(
tooltip
.
popperElm
.
style
.
display
).
to
.
equal
(
'
none
'
);
done
();
},
500
);
},
150
);
});
it
(
'
light mode
'
,
()
=>
{
const
vm
=
createVue
(
`
<el-tooltip content="abc" effect="light">
<button>abc</button>
</el-tooltip>
`
);
expect
(
vm
.
$el
.
querySelector
(
'
.is-light
'
)).
to
.
exist
;
});
});
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