Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

5.2 KB
Raw Blame

[
    {
        "name": "channel_link",
        "near_link": "http://testserver/#narrow/channel/13-Denmark",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            }
        ]
    },
    {
        "name": "topic_link",
        "near_link": "http://testserver/#narrow/channel/13-Denmark/topic/desktop",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            },
            {
                "operator": "topic",
                "operand": "desktop",
                "negated": false
            }
        ]
    },
    {
        "name": "decoded_topic_link",
        "near_link": "http://testserver/#narrow/channel/13-Denmark/topic/Broken.20Inline.20giphy.20preview.20.2F.20Messed.20up.20with.20camo",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            },
            {
                "operator": "topic",
                "operand": "Broken Inline giphy preview / Messed up with camo",
                "negated": false
            }
        ]
    },
    {
        "name": "missing_topic_operand",
        "near_link": "http://testserver/#narrow/channel/13-Denmark/topic",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            },
            {
                "operator": "topic",
                "operand": "",
                "negated": false
            }
        ]
    },
    {
        "name": "channel_message_link",
        "near_link": "http://testserver/#narrow/channel/13-Denmark/topic/desktop/near/555",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            },
            {
                "operator": "topic",
                "operand": "desktop",
                "negated": false
            },
            {
                "operator": "near",
                "operand": 555,
                "negated": false
            }
        ]
    },
    {
        "name": "dm_link",
        "near_link": "http://testserver/#narrow/dm/95-Calcifer",
        "expected_output": [
            {
                "operator": "dm",
                "operand": 95,
                "negated": false
            }
        ]
    },
    {
        "name": "near_dm_link",
        "near_link": "http://testserver/#narrow/dm/15-John/near/19",
        "expected_output": [
            {
                "operator": "dm",
                "operand": 15,
                "negated": false
            },
            {
                "operator": "near",
                "operand": 19,
                "negated": false
            }
        ]
    },
    {
        "name": "gdm_link",
        "near_link": "http://testserver/#narrow/dm/15,12,13-group",
        "expected_output": [
            {
                "operator": "dm",
                "operand": [15,12,13],
                "negated": false
            }
        ]
    },
    {
        "name": "near_gdm_link",
        "near_link": "http://testserver/#narrow/dm/15,12,13-group/near/12",
        "expected_output": [
            {
                "operator": "dm",
                "operand": [15,12,13],
                "negated": false
            },
            {
                "operator": "near",
                "operand": 12,
                "negated": false
            }
        ]
    },
    {
        "name": "mentions_link",
        "near_link": "http://testserver/#narrow/mentions/35-Iago",
        "expected_output": [
            {
                "operator": "mentions",
                "operand": 35,
                "negated": false
            }
        ]
    },
    {
        "name": "legacy_channel_synonym",
        "near_link": "http://testserver/#narrow/stream/13-Denmark",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": false
            }
        ]
    },
    {
        "name": "hypothetical_negated_link",
        "near_link": "http://testserver/#narrow/-channel/13-Denmark",
        "expected_output": [
            {
                "operator": "channel",
                "operand": 13,
                "negated": true
            }
        ]
    },
    {
        "name": "legacy_channel_slug_unsupported",
        "near_link": "http://testserver/#narrow/channel/test-here",
        "expected_output": null
    },
    {
        "name": "broken_link_no_channel_operand",
        "near_link": "http://testserver/#narrow/channel/%20",
        "expected_output": null
    },
    {
        "name": "broken_link_other_operand",
        "near_link": "http://testserver/#narrow/near/%20",
        "expected_output": null
    },
    {
        "name": "broken_link_no_operator",
        "near_link": "http://testserver/#narrow/%20/test-here",
        "expected_output": null
    },
    {
        "name": "broken_link_invalid_message_operand",
        "near_link": "http://testserver/#narrow/near/13-Denmark",
        "expected_output": null
    }
]