Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_jquery.js #440

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/test_jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module('jQuery.URI', {
setup: function() {
var links = [
let links = [
'<a href="http://example.org/">an HTTP link</a>',
'<a href="https://example.org/">an HTTPS link</a>',
'<a href="http://example.org/so)me.pdf">some pdf</a>',
Expand All @@ -24,32 +24,32 @@
$('<div>foo</div>')
.appendTo(document.body);

var script = document.createElement('script');
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/nonexistant.js';
document.getElementById('testestest').appendChild(script);
},
teardown: function() {
var t = $('#testestest');
let t = $('#testestest');
t.next().remove();
t.remove();
}
});
test('.uri()', function() {
var $links = $('#testestest'),
let $links = $('#testestest'),
$first = $links.children().first(),
uri = $first.uri(),
_uri = URI('/hello.world');

ok(uri !== _uri, 'different URI instances');
var __uri = $first.uri(_uri);
let __uri = $first.uri(_uri);
ok(uri !== _uri, 'different URI instances');
ok(uri === __uri, 'same URI instances');
equal($first.attr('href'), _uri.toString(), 'equal URI');

});
test('filtering with :uri()', function() {
var $links = $('#testestest');
let $links = $('#testestest');

// find using accessor and "begins with" comparison
equal($('a:uri(href^=#anc)').length, 1, '$(selector) Anchor Link');
Expand Down Expand Up @@ -90,7 +90,7 @@
equal($('div').has(':uri(suffix=js)').length, 1, '.has(\':uri(suffix=js)\')');
});
test('.attr("href")', function() {
var $links = $('#testestest'),
let $links = $('#testestest'),
$first = $links.children().first(),
first = $first.get(0),
uri = $first.uri(),
Expand Down Expand Up @@ -118,7 +118,7 @@
equal(href(first), uri.toString(), 'transparent href update');
});
test('.attr("uri:accessor")', function() {
var $links = $('#testestest'),
let $links = $('#testestest'),
$first = $links.children().first(),
uri = $first.uri(),
href = function(elem) {
Expand All @@ -138,4 +138,4 @@
ok($first.uri() === uri, 'URI persisted');
});

})();
})();