Skip to content

Commit e133c82

Browse files
committed
Tests: Remove unneeded static HTML markup in fixture
This was leftover from 1.x and never culled. Newer tests should in most cases just insert the markup they need to do their tests and not assume static markup in the main fixture. For more complex cases it may be better to create an iframe test rather than cluttering the common fixture in index.html!
1 parent a1d5f0d commit e133c82

File tree

2 files changed

+3
-177
lines changed

2 files changed

+3
-177
lines changed

test/event.js

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ QUnit.test( "Event aliases", function( assert ) {
130130
QUnit.test( "custom ready", function( assert ) {
131131
assert.expect( 2 );
132132

133+
jQuery("#qunit-fixture").append("<div id='foo'>bar</div>");
134+
133135
expectNoWarning( assert, "Custom ready event not on document", 1, function() {
134136
jQuery( "#foo" ).on( "ready", function() {
135137
assert.ok( true, "custom ready event was triggered" );

test/index.html

+1-177
Original file line numberDiff line numberDiff line change
@@ -38,182 +38,6 @@
3838
</head>
3939
<body>
4040
<div id="qunit"></div>
41-
42-
<!-- Test HTML -->
43-
<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
44-
<div id="nothiddendivchild"></div>
45-
</div>
46-
47-
<div id="qunit-fixture">
48-
49-
<p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
50-
<p id="ap">
51-
Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
52-
<a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
53-
This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
54-
<a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
55-
56-
</p>
57-
<div id="foo">
58-
<p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
59-
<p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
60-
<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
61-
<img src="data/1x1.jpg" />
62-
</div>
63-
<div id="liveHandlerOrder">
64-
<span id="liveSpan1"><a href="#" id="liveLink1"></a></span>
65-
<span id="liveSpan2"><a href="#" id="liveLink2"></a></span>
66-
</div>
67-
68-
<p id="first">Try them out:</p>
69-
<ul id="firstUL"></ul>
70-
<ol id="empty"></ol>
71-
<form id="form" action="formaction">
72-
<label for="action" id="label-for">Action:</label>
73-
<input type="text" name="action" value="Test" id="text1" maxlength="30"/>
74-
<input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>
75-
<input type="radio" name="radio1" id="radio1" value="on"/>
76-
77-
<input type="radio" name="radio2" id="radio2" checked="checked"/>
78-
<input type="checkbox" name="check" id="check1" checked="checked"/>
79-
<input type="checkbox" id="check2" value="on"/>
80-
81-
<input type="hidden" name="hidden" id="hidden1"/>
82-
<input type="text" style="display:none;" name="foo[bar]" id="hidden2"/>
83-
84-
<input type="text" id="name" name="name" value="name" />
85-
<input type="search" id="search" name="search" value="search" />
86-
87-
<button id="button" name="button" type="button">Button</button>
88-
89-
<textarea id="area1" maxlength="30">foobar</textarea>
90-
91-
<select name="select1" id="select1">
92-
<option id="option1a" class="emptyopt" value="">Nothing</option>
93-
<option id="option1b" value="1">1</option>
94-
<option id="option1c" value="2">2</option>
95-
<option id="option1d" value="3">3</option>
96-
</select>
97-
<select name="select2" id="select2">
98-
<option id="option2a" class="emptyopt" value="">Nothing</option>
99-
<option id="option2b" value="1">1</option>
100-
<option id="option2c" value="2">2</option>
101-
<option id="option2d" selected="selected" value="3">3</option>
102-
</select>
103-
<select name="select3" id="select3" multiple="multiple">
104-
<option id="option3a" class="emptyopt" value="">Nothing</option>
105-
<option id="option3b" selected="selected" value="1">1</option>
106-
<option id="option3c" selected="selected" value="2">2</option>
107-
<option id="option3d" value="3">3</option>
108-
<option id="option3e">no value</option>
109-
</select>
110-
<select name="select4" id="select4" multiple="multiple">
111-
<optgroup disabled="disabled">
112-
<option id="option4a" class="emptyopt" value="">Nothing</option>
113-
<option id="option4b" disabled="disabled" selected="selected" value="1">1</option>
114-
<option id="option4c" selected="selected" value="2">2</option>
115-
</optgroup>
116-
<option selected="selected" disabled="disabled" id="option4d" value="3">3</option>
117-
<option id="option4e">no value</option>
118-
</select>
119-
<select name="select5" id="select5">
120-
<option id="option5a" value="3">1</option>
121-
<option id="option5b" value="2">2</option>
122-
<option id="option5c" value="1" data-attr="">3</option>
123-
</select>
124-
125-
<object id="object1" codebase="stupid">
126-
<param name="p1" value="x1" />
127-
<param name="p2" value="x2" />
128-
</object>
129-
130-
<span id="??Ta´ibe?i"></span>
131-
<span id="??" lang="??"></span>
132-
<span id="utf8class1" class="??Ta´ibe?i ??"></span>
133-
<span id="utf8class2" class="??"></span>
134-
<span id="foo:bar" class="foo:bar"></span>
135-
<span id="test.foo[5]bar" class="test.foo[5]bar"></span>
136-
137-
<foo_bar id="foobar">test element</foo_bar>
138-
</form>
139-
<b id="floatTest">Float test.</b>
140-
<iframe id="iframe" name="iframe"></iframe>
141-
<form id="lengthtest">
142-
<input type="text" id="length" name="test"/>
143-
<input type="text" id="idTest" name="id"/>
144-
</form>
145-
<table id="table"></table>
146-
147-
<form id="name-tests">
148-
<!-- Inputs with a grouped name attribute. -->
149-
<input name="types[]" id="types_all" type="checkbox" value="all" />
150-
<input name="types[]" id="types_anime" type="checkbox" value="anime" />
151-
<input name="types[]" id="types_movie" type="checkbox" value="movie" />
152-
</form>
153-
154-
<form id="testForm" action="#" method="get">
155-
<textarea name="T3" rows="2" cols="15">?
156-
Z</textarea>
157-
<input type="hidden" name="H1" value="x" />
158-
<input type="hidden" name="H2" />
159-
<input name="PWD" type="password" value="" />
160-
<input name="T1" type="text" />
161-
<input name="T2" type="text" value="YES" readonly="readonly" />
162-
<input type="checkbox" name="C1" value="1" />
163-
<input type="checkbox" name="C2" />
164-
<input type="radio" name="R1" value="1" />
165-
<input type="radio" name="R1" value="2" />
166-
<input type="text" name="My Name" value="me" />
167-
<input type="reset" name="reset" value="NO" />
168-
<select name="S1">
169-
<option value="abc">ABC</option>
170-
<option value="abc">ABC</option>
171-
<option value="abc">ABC</option>
172-
</select>
173-
<select name="S2" multiple="multiple" size="3">
174-
<option value="abc">ABC</option>
175-
<option value="abc">ABC</option>
176-
<option value="abc">ABC</option>
177-
</select>
178-
<select name="S3">
179-
<option selected="selected">YES</option>
180-
</select>
181-
<select name="S4">
182-
<option value="" selected="selected">NO</option>
183-
</select>
184-
<input type="submit" name="sub1" value="NO" />
185-
<input type="submit" name="sub2" value="NO" />
186-
<input type="image" name="sub3" value="NO" />
187-
<button name="sub4" type="submit" value="NO">NO</button>
188-
<input name="D1" type="text" value="NO" disabled="disabled" />
189-
<input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO" />
190-
<input type="radio" name="D3" value="NO" checked="checked" disabled="disabled" />
191-
<select name="D4" disabled="disabled">
192-
<option selected="selected" value="NO">NO</option>
193-
</select>
194-
<input id="list-test" type="text" />
195-
<datalist id="datalist">
196-
<option value="option"></option>
197-
</datalist>
198-
</form>
199-
<div id="moretests">
200-
<form>
201-
<div id="checkedtest" style="display:none;">
202-
<input type="radio" name="checkedtestradios" checked="checked"/>
203-
<input type="radio" name="checkedtestradios" value="on"/>
204-
<input type="checkbox" name="checkedtestcheckboxes" checked="checked"/>
205-
<input type="checkbox" name="checkedtestcheckboxes" />
206-
</div>
207-
</form>
208-
<div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
209-
<div id="t2037">
210-
<div><div class="hidden">hidden</div></div>
211-
</div>
212-
<div id="t6652">
213-
<div></div>
214-
</div>
215-
<div id="no-clone-exception"><object><embed></embed></object></div>
216-
</div>
217-
</div>
41+
<div id="qunit-fixture"></div>
21842
</body>
21943
</html>

0 commit comments

Comments
 (0)