Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
5d70c6d7
Commit
5d70c6d7
authored
Apr 17, 2011
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in unit tests for #6993.
parent
6e3b5965
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
event.js
test/unit/event.js
+7
-1
No files found.
test/unit/event.js
View file @
5d70c6d7
...
...
@@ -15,7 +15,7 @@ test("null or undefined handler", function() {
});
test
(
"bind(), with data"
,
function
()
{
expect
(
3
);
expect
(
4
);
var
handler
=
function
(
event
)
{
ok
(
event
.
data
,
"bind() with data, check passed data exists"
);
equals
(
event
.
data
.
foo
,
"bar"
,
"bind() with data, Check value of passed data"
);
...
...
@@ -23,6 +23,12 @@ test("bind(), with data", function() {
jQuery
(
"#firstp"
).
bind
(
"click"
,
{
foo
:
"bar"
},
handler
).
click
().
unbind
(
"click"
,
handler
);
ok
(
!
jQuery
.
_data
(
jQuery
(
"#firstp"
)[
0
],
"events"
),
"Event handler unbound when using data."
);
var
test
=
function
(){};
var
handler2
=
function
(
event
)
{
equals
(
event
.
data
,
test
,
"bind() with function data, Check value of passed data"
);
};
jQuery
(
"#firstp"
).
bind
(
"click"
,
test
,
handler2
).
click
().
unbind
(
"click"
,
handler2
);
});
test
(
"click(), with data"
,
function
()
{
...
...
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