Python backend for a Slack's kudos plugin.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: test for leave meet

+76
+76
kefi/tests/test_interactivity.py
··· 109 109 ) 110 110 response = client.post("/interactivity/", data={"payload": payload}) 111 111 assert response.status_code == 200 112 + 113 + 114 + def test_meet_leave_view_submission(client: TestClient, mocker: MockerFixture): 115 + views_open = mocker.patch.object(WebClient, "views_open") 116 + views_open_response: dict = {} # Adds expected response here 117 + views_open.side_effect = [views_open_response] 118 + payload = json.dumps( 119 + { 120 + "type": "view_submission", 121 + "team": {"id": "T0RS507QX", "domain": "dekalabs"}, 122 + "user": { 123 + "id": "UCBKX2GQ4", 124 + "username": "marcos", 125 + "name": "marcos", 126 + "team_id": "T0RS507QX", 127 + }, 128 + "api_app_id": "A0499FQH7V3", 129 + "token": "7n993LRqLRydOnIkEhymVcYD", 130 + "trigger_id": "4338017757538.25889007847.877c730e79e8a4b1917de09d38a8daa0", 131 + "view": { 132 + "id": "V04AMLW580G", 133 + "team_id": "T0RS507QX", 134 + "type": "modal", 135 + "blocks": [ 136 + { 137 + "type": "section", 138 + "block_id": "9n+9", 139 + "text": { 140 + "type": "mrkdwn", 141 + "text": "*:wave: \\u00a1Hola! \\u00bfTe vienes a la Kefi Plaza?*", 142 + "verbatim": False, 143 + }, 144 + }, 145 + {"type": "divider", "block_id": "MSUNF"}, 146 + { 147 + "type": "section", 148 + "block_id": "IbY", 149 + "text": { 150 + "type": "mrkdwn", 151 + "text": "*Pr\\u00f3ximo encuentro*\\nFriday, 11 November\\n10:00\\n", 152 + "verbatim": False, 153 + }, 154 + "accessory": { 155 + "type": "image", 156 + "image_url": "https:\\/\\/api.slack.com\\/img\\/blocks\\/bkb_template_images\\/notifications.png", 157 + "alt_text": "calendar thumbnail", 158 + }, 159 + }, 160 + ], 161 + "private_metadata": "", 162 + "callback_id": "meet_leave", 163 + "state": {"values": {}}, 164 + "hash": "1667896295.Ry45BkuV", 165 + "title": {"type": "plain_text", "text": "Kefi", "emoji": True}, 166 + "clear_on_close": False, 167 + "notify_on_close": False, 168 + "close": {"type": "plain_text", "text": "Cancelar", "emoji": True}, 169 + "submit": { 170 + "type": "plain_text", 171 + "text": "\\u00a1Me apunto!", 172 + "emoji": True, 173 + }, 174 + "previous_view_id": None, 175 + "root_view_id": "V04AMLW580G", 176 + "app_id": "A0499FQH7V3", 177 + "external_id": "", 178 + "app_installed_team_id": "T0RS507QX", 179 + "bot_id": "B0495T0Q0S2", 180 + }, 181 + "response_urls": [], 182 + "is_enterprise_install": False, 183 + "enterprise": None, 184 + } 185 + ) 186 + response = client.post("/interactivity/", data={"payload": payload}) 187 + assert response.status_code == 200