Skip to content

Commit 53d375c

Browse files
committed
Unit test for issue jquery-archive#1913 - unnecessary ajax call and duplicate DOM nodes when refreshing a page with a dialog visible.
1 parent c81b8cc commit 53d375c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

tests/unit/navigation/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ <h2 id="qunit-userAgent"></h2>
2828
<ol id="qunit-tests">
2929
</ol>
3030

31-
<div id="foo" data-nstest-role="page">
31+
<div id="foo" data-nstest-role="page" class="foo-class">
3232
<a href="#bar" data-nstest-transition="flip"></a>
3333
</div>
3434

35+
<div id="foozball" data-nstest-role="page">
36+
</div>
37+
3538
<div id="bar" data-nstest-role="page">
3639
<a href="#baz"></a>
3740
</div>

tests/unit/navigation/navigation_core.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,21 @@
476476
}
477477
]);
478478
});
479+
480+
asyncTest( "refresh of a dialog url should not duplicate page", function(){
481+
482+
$.testHelper.pageSequence([
483+
// open our test page
484+
function(){
485+
same($(".foo-class").length, 1, "should only have one instance of foo-class in the document");
486+
location.hash = "#foo&ui-state=dialog";
487+
},
488+
489+
function(){
490+
same(location.hash, "#foo&ui-state=dialog", "hash should match what was loaded");
491+
same($(".foo-class").length, 1, "should only have one instance of foo-class in the document");
492+
start();
493+
}
494+
]);
495+
});
479496
})(jQuery);

0 commit comments

Comments
 (0)