Skip to content

Commit dc4712a

Browse files
committed
Untangle "mixed containers" test
1 parent 297eabc commit dc4712a

File tree

1 file changed

+14
-31
lines changed

1 file changed

+14
-31
lines changed

test/unit/pjax.js

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -254,38 +254,21 @@ if ($.support.pjax) {
254254
}, 0)
255255
})
256256

257-
asyncTest("mixed containers", function() {
258-
var frame = this.frame
259-
260-
frame.$.pjax({
261-
url: "fragment.html",
262-
container: "#main"
257+
asyncTest("mixed containers", 4, function() {
258+
navigate(this.frame)
259+
.pjax({ url: "fragment.html", container: "#main" })
260+
.pjax({ url: "aliens.html", container: "#foo" }, function(frame) {
261+
equal(frame.$("#main > #foo > ul > li").last().text(), "aliens")
263262
})
264-
265-
frame.$("#main").one("pjax:end", function() {
266-
frame.$.pjax({
267-
url: "aliens.html",
268-
container: "#foo"
269-
})
270-
271-
frame.$("#foo").one("pjax:end", function() {
272-
equal(frame.$("#main > #foo > ul > li").last().text(), "aliens")
273-
274-
goBack(frame, function() {
275-
equal(frame.$("#main > #foo").text().trim(), "Foo")
276-
277-
goBack(frame, function() {
278-
equal(frame.$("#main > ul > li").first().text(), "home")
279-
280-
goForward(frame, function() {
281-
goForward(frame, function() {
282-
equal(frame.$("#main > #foo > ul > li").last().text(), "aliens")
283-
start()
284-
})
285-
})
286-
})
287-
})
288-
})
263+
.back(-1, function(frame) {
264+
equal(frame.$("#main > #foo").text().trim(), "Foo")
265+
})
266+
.back(-1, function(frame) {
267+
equal(frame.$("#main > ul > li").first().text(), "home")
268+
})
269+
.back(+1)
270+
.back(+1, function(frame) {
271+
equal(frame.$("#main > #foo > ul > li").last().text(), "aliens")
289272
})
290273
})
291274

0 commit comments

Comments
 (0)