mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
stream_settings: Fix stream row switching behavior.
Add a rule to the switch_rows(event) function to avoid switching stream row when pressing up/down key by checking the current URL hash and the add_subscribers_pill focus state. Add a utility function to hash_parser to help implement new switch_rows behavior mentioned above. Fixes #29690.
This commit is contained in:
@@ -161,6 +161,23 @@ run_test("test_is_create_new_stream_narrow", () => {
|
||||
assert.equal(hash_parser.is_create_new_stream_narrow(), false);
|
||||
});
|
||||
|
||||
run_test("test_is_subscribers_section_opened_for_stream", () => {
|
||||
window.location.hash = "#streams/1/Design/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), true);
|
||||
|
||||
window.location.hash = "#streams/99/.EC.A1.B0.EB.A6.AC.EB.B2.95.20.F0.9F.98.8E/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), true);
|
||||
|
||||
window.location.hash = "#streams/random/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), false);
|
||||
|
||||
window.location.hash = "#some/random/place/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), false);
|
||||
|
||||
window.location.hash = "#";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), false);
|
||||
});
|
||||
|
||||
run_test("test_parse_narrow", () => {
|
||||
assert.deepEqual(hash_util.parse_narrow(["narrow", "stream", "99-frontend"]), [
|
||||
{negated: false, operator: "stream", operand: "frontend"},
|
||||
|
||||
Reference in New Issue
Block a user