Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit d40ba47

Browse files
author
Gabriel Schulhof
committed
Pagecontainer: Test behavior of _find() in the face of weird URLs
1 parent c09cde5 commit d40ba47

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/unit/pagecontainer/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
<a href="page-does-not-exist.html" id="go-to-nonexistent-page">Go to non-existent page</a>
3737
</div>
3838
</div>
39+
<div data-nstest-role="page" data-nstest-url="Raison d'être.html" class="weird-data-url"></div>
3940
</body>
4041
</html>

tests/unit/pagecontainer/pagecontainer_core.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
test( "_find() can handle weird data-url attributes", function() {
2+
deepEqual(
3+
$.mobile.pagecontainer.prototype._find.call({
4+
_createFileUrl: $.mobile.pagecontainer.prototype._createFileUrl,
5+
_createDataUrl: $.mobile.pagecontainer.prototype._createDataUrl,
6+
_getInitialContent: $.mobile.pagecontainer.prototype._getInitialContent,
7+
element: $( "body" ),
8+
_getNs: $.mobile.pagecontainer.prototype._getNs,
9+
10+
}, "Raison d'être.html" )[ 0 ],
11+
$( ".weird-data-url" )[ 0 ],
12+
"Correct element is retrieved when the file name is weird" );
13+
});
14+
115
( function() {
216
var originalLoad = $.mobile.pagecontainer.prototype._triggerWithDeprecated
317
module( "load method", {

0 commit comments

Comments
 (0)