Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-09-06 14:20:33 +05:30
parent a54413625e
commit 4f4bc8f805

View file

@ -327,6 +327,28 @@ export function tests() {
assert.equal(segments[4].type, "details");
assert.equal(segments[4].value, true);
},
"open-room action should only copy over previous segments if there are no parts after open-room": assert => {
const nav = new Navigation(allowsChild);
const path = nav.pathFrom([
new Segment("session", 1),
new Segment("rooms", ["a", "b", "c"]),
new Segment("room", "b"),
new Segment("right-panel", true),
new Segment("members", true)
]);
const segments = parseUrlPath("/session/1/open-room/a/member/foo", path);
assert.equal(segments.length, 5);
assert.equal(segments[0].type, "session");
assert.equal(segments[0].value, "1");
assert.equal(segments[1].type, "rooms");
assert.deepEqual(segments[1].value, ["a", "b", "c"]);
assert.equal(segments[2].type, "room");
assert.equal(segments[2].value, "a");
assert.equal(segments[3].type, "right-panel");
assert.equal(segments[3].value, true);
assert.equal(segments[4].type, "member");
assert.equal(segments[4].value, "foo");
},
"parse open-room action setting a room in an empty tile": assert => {
const nav = new Navigation(allowsChild);
const path = nav.pathFrom([