Skip to content

Commit 0bc1bda

Browse files
committed
chore: thorough test case
1 parent 47d61cc commit 0bc1bda

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Diff for: tests/app/tests/ns-location-strategy.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,33 @@ describe("NSLocationStrategy", () => {
281281
assert.equal(strategy.path(), "/test");
282282
assert.equal(popCount, 0);
283283

284+
strategy.pushState(null, "test2", "/test2?param2=2", null);
285+
assert.equal(strategy.path(), "/test2?param2=2");
286+
assert.equal(popCount, 0);
287+
288+
strategy.pushState(null, "test3", "/test3?param3=3", null);
289+
assert.equal(strategy.path(), "/test3?param3=3");
290+
assert.equal(popCount, 0);
291+
292+
strategy.pushState(null, "test4", "/test4", null);
293+
assert.equal(strategy.path(), "/test4");
294+
assert.equal(popCount, 0);
295+
284296
strategy.back();
285-
assert.equal(strategy.path(), "/?param=1");
297+
assert.equal(strategy.path(), "/test3?param3=3");
286298
assert.equal(popCount, 1);
299+
300+
strategy.back();
301+
assert.equal(strategy.path(), "/test2?param2=2");
302+
assert.equal(popCount, 2);
303+
304+
strategy.back();
305+
assert.equal(strategy.path(), "/test");
306+
assert.equal(popCount, 3);
307+
308+
strategy.back();
309+
assert.equal(strategy.path(), "/?param=1");
310+
assert.equal(popCount, 4);
287311
});
288312

289313
it("pushState() with page navigation", () => {

0 commit comments

Comments
 (0)