Skip to content

Commit

Permalink
Tests: replace dead links in qunit fixture; use https
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Aug 11, 2024
1 parent a547ea7 commit 250ad48
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 145 deletions.
14 changes: 7 additions & 7 deletions test/data/qunit-fixture.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<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>
<p id="firstp">See <a id="john1" href="https://johnresig.com/blog/10th-anniversary-of-jquery/#body" rel="bookmark">this blog entry</a> for more information.</p>
<p id="ap">
Here are some [links] in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
<a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
This link has <code id="code1"><a href="http://smin" id="anchor1">class="blog"</a></code>:
<a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
Here are some [links] in a normal paragraph: <a id="google" href="https://www.google.com/" title="Google!">Google</a>,
<a id="groups" href="https://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
This link has <code id="code1"><a href="https://blog" id="anchor1">class="blog"</a></code>:
<a href="https://mozilla.org/" class="blog" hreflang="en" id="mozilla">mozilla</a>

</p>
<div id="foo">
<p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
<p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
<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>
<p lang="en" id="en">This is a normal link: <a id="yahoo" href="https://www.yahoo.com/" class="blogTest">Yahoo</a></p>
<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="https://timmywil.com/" class="blog link" id="timmy">Timmy Willison's Weblog</a></p>

</div>
<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
Expand Down
6 changes: 3 additions & 3 deletions test/unit/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ QUnit.test( "attr(String)", function( assert ) {
assert.equal( jQuery( "#text1" ).attr( "type" ), "text", "Check for type attribute" );
assert.equal( jQuery( "#radio1" ).attr( "type" ), "radio", "Check for type attribute" );
assert.equal( jQuery( "#check1" ).attr( "type" ), "checkbox", "Check for type attribute" );
assert.equal( jQuery( "#simon1" ).attr( "rel" ), "bookmark", "Check for rel attribute" );
assert.equal( jQuery( "#john1" ).attr( "rel" ), "bookmark", "Check for rel attribute" );
assert.equal( jQuery( "#google" ).attr( "title" ), "Google!", "Check for title attribute" );
assert.equal( jQuery( "#mark" ).attr( "hreflang" ), "en", "Check for hreflang attribute" );
assert.equal( jQuery( "#mozilla" ).attr( "hreflang" ), "en", "Check for hreflang attribute" );
assert.equal( jQuery( "#en" ).attr( "lang" ), "en", "Check for lang attribute" );
assert.equal( jQuery( "#simon" ).attr( "class" ), "blog link", "Check for class attribute" );
assert.equal( jQuery( "#timmy" ).attr( "class" ), "blog link", "Check for class attribute" );
assert.equal( jQuery( "#name" ).attr( "name" ), "name", "Check for name attribute" );
assert.equal( jQuery( "#text1" ).attr( "name" ), "action", "Check for name attribute" );
assert.ok( jQuery( "#form" ).attr( "action" ).indexOf( "formaction" ) >= 0, "Check for action attribute" );
Expand Down
16 changes: 8 additions & 8 deletions test/unit/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,14 @@ QUnit.test( "inArray()", function( assert ) {
p: q( "firstp", "sap", "ap", "first" ),
em: q( "siblingnext", "siblingfirst" ),
div: q( "qunit-testrunner-toolbar", "nothiddendiv", "nothiddendivchild", "foo" ),
a: q( "mark", "groups", "google", "simon1" ),
a: q( "mozilla", "groups", "google", "john1" ),
empty: []
},
tests = {
p: { elem: jQuery( "#ap" )[ 0 ], index: 2 },
em: { elem: jQuery( "#siblingfirst" )[ 0 ], index: 1 },
div: { elem: jQuery( "#nothiddendiv" )[ 0 ], index: 1 },
a: { elem: jQuery( "#simon1" )[ 0 ], index: 3 }
a: { elem: jQuery( "#john1" )[ 0 ], index: 3 }
},
falseTests = {
p: jQuery( "#liveSpan1" )[ 0 ],
Expand Down Expand Up @@ -654,13 +654,13 @@ QUnit.test( "slice()", function( assert ) {
var $links = jQuery( "#ap a" );

assert.deepEqual( $links.slice( 1, 2 ).get(), q( "groups" ), "slice(1,2)" );
assert.deepEqual( $links.slice( 1 ).get(), q( "groups", "anchor1", "mark" ), "slice(1)" );
assert.deepEqual( $links.slice( 1 ).get(), q( "groups", "anchor1", "mozilla" ), "slice(1)" );
assert.deepEqual( $links.slice( 0, 3 ).get(), q( "google", "groups", "anchor1" ), "slice(0,3)" );
assert.deepEqual( $links.slice( -1 ).get(), q( "mark" ), "slice(-1)" );
assert.deepEqual( $links.slice( -1 ).get(), q( "mozilla" ), "slice(-1)" );

assert.deepEqual( $links.eq( 1 ).get(), q( "groups" ), "eq(1)" );
assert.deepEqual( $links.eq( "2" ).get(), q( "anchor1" ), "eq('2')" );
assert.deepEqual( $links.eq( -1 ).get(), q( "mark" ), "eq(-1)" );
assert.deepEqual( $links.eq( -1 ).get(), q( "mozilla" ), "eq(-1)" );
} );

QUnit.test( "first()/last()", function( assert ) {
Expand All @@ -669,7 +669,7 @@ QUnit.test( "first()/last()", function( assert ) {
var $links = jQuery( "#ap a" ), $none = jQuery( "asdf" );

assert.deepEqual( $links.first().get(), q( "google" ), "first()" );
assert.deepEqual( $links.last().get(), q( "mark" ), "last()" );
assert.deepEqual( $links.last().get(), q( "mozilla" ), "last()" );

assert.deepEqual( $none.first().get(), [], "first() none" );
assert.deepEqual( $none.last().get(), [], "last() none" );
Expand All @@ -681,7 +681,7 @@ QUnit.test( "even()/odd()", function( assert ) {
var $links = jQuery( "#ap a" ), $none = jQuery( "asdf" );

assert.deepEqual( $links.even().get(), q( "google", "anchor1" ), "even()" );
assert.deepEqual( $links.odd().get(), q( "groups", "mark" ), "odd()" );
assert.deepEqual( $links.odd().get(), q( "groups", "mozilla" ), "odd()" );

assert.deepEqual( $none.even().get(), [], "even() none" );
assert.deepEqual( $none.odd().get(), [], "odd() none" );
Expand All @@ -694,7 +694,7 @@ QUnit.test( "map()", function( assert ) {
jQuery( "#ap" ).map( function() {
return jQuery( this ).find( "a" ).get();
} ).get(),
q( "google", "groups", "anchor1", "mark" ),
q( "google", "groups", "anchor1", "mozilla" ),
"Array Map"
);

Expand Down
4 changes: 2 additions & 2 deletions test/unit/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ QUnit.test( "trigger() shortcuts", function( assert ) {
assert.equal( counter, 1, "Check that click, triggers onclick event handler also" );

clickCounter = 0;
jQuery( "#simon1" )[ 0 ].onclick = function() {
jQuery( "#john1" )[ 0 ].onclick = function() {
clickCounter++;
};
jQuery( "#simon1" ).click();
jQuery( "#john1" ).click();
assert.equal( clickCounter, 1, "Check that click, triggers onclick event handler on an a tag also" );
} );

Expand Down
2 changes: 1 addition & 1 deletion test/unit/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ QUnit.test( "hide, fadeOut and slideUp called on element width height and width
QUnit.test( "hide should not leave hidden inline elements visible (trac-14848)", function( assert ) {
assert.expect( 2 );

var el = jQuery( "#simon1" );
var el = jQuery( "#john1" );

el.hide( 1, function() {
assert.equal( el.css( "display" ), "none", "hidden" );
Expand Down
Loading

0 comments on commit 250ad48

Please sign in to comment.