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
47c80c20
Commit
47c80c20
authored
Mar 25, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for bug#3685, remove added html and add dynamicly to avoid global test suite errors
parent
9e05a0a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
index.html
test/index.html
+0
-2
attributes.js
test/unit/attributes.js
+6
-1
No files found.
test/index.html
View file @
47c80c20
...
...
@@ -203,8 +203,6 @@ Z</textarea>
<select
name=
"D4"
disabled=
"disabled"
>
<option
selected=
"selected"
value=
"NO"
>
NO
</option>
</select>
<input
name=
"id"
/>
<input
id=
"target"
name=
"target"
/>
</form>
<div
id=
"moretests"
>
<form>
...
...
test/unit/attributes.js
View file @
47c80c20
...
...
@@ -75,7 +75,7 @@ test("prop(String, Object)", function() {
});
test
(
"attr(String)"
,
function
()
{
expect
(
2
4
);
expect
(
2
5
);
equals
(
jQuery
(
'#text1'
).
attr
(
'type'
),
"text"
,
'Check for type attribute'
);
equals
(
jQuery
(
'#radio1'
).
attr
(
'type'
),
"radio"
,
'Check for type attribute'
);
...
...
@@ -88,11 +88,16 @@ test("attr(String)", function() {
equals
(
jQuery
(
'#name'
).
attr
(
'name'
),
"name"
,
'Check for name attribute'
);
equals
(
jQuery
(
'#text1'
).
attr
(
'name'
),
"action"
,
'Check for name attribute'
);
ok
(
jQuery
(
'#form'
).
attr
(
'action'
).
indexOf
(
"formaction"
)
>=
0
,
'Check for action attribute'
);
// [7472] & [3113] (form contains an input with name="action" or name="id")
var
extras
=
jQuery
(
'<input name="id" name="name" /><input id="target" name="target" />'
).
appendTo
(
'#testForm'
);
equals
(
jQuery
(
'#form'
).
attr
(
'action'
,
'newformaction'
).
attr
(
'action'
),
'newformaction'
,
'Check that action attribute was changed'
);
equals
(
jQuery
(
'#testForm'
).
attr
(
'target'
),
undefined
,
'Retrieving target does not equal the input with name=target'
);
equals
(
jQuery
(
'#testForm'
).
attr
(
'target'
,
'newTarget'
).
attr
(
'target'
),
'newTarget'
,
'Set target successfully on a form'
);
equals
(
jQuery
(
'#testForm'
).
removeAttr
(
'id'
).
attr
(
'id'
),
undefined
,
'Retrieving id does not equal the input with name=id after id is removed [#7472]'
);
// Bug #3685 (form contains input with name="name")
equals
(
jQuery
(
'#testForm'
).
attr
(
'name'
),
undefined
,
'Retrieving name does not retrieve input with name=name'
);
extras
.
remove
();
equals
(
jQuery
(
'#text1'
).
attr
(
'maxlength'
),
'30'
,
'Check for maxlength attribute'
);
equals
(
jQuery
(
'#text1'
).
attr
(
'maxLength'
),
'30'
,
'Check for maxLength attribute'
);
...
...
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