diff --git a/engine/apps/slack/tests/test_scenario_steps/test_slack_channel_integration.py b/engine/apps/slack/tests/test_scenario_steps/test_slack_channel_integration.py index 625c662530..fbce8203cd 100644 --- a/engine/apps/slack/tests/test_scenario_steps/test_slack_channel_integration.py +++ b/engine/apps/slack/tests/test_scenario_steps/test_slack_channel_integration.py @@ -219,6 +219,7 @@ def test_save_thread_message_for_resolution_note_really_long_text( make_alert_receive_channel, make_alert_group, make_slack_message, + make_slack_channel, ) -> None: ( organization, @@ -229,11 +230,13 @@ def test_save_thread_message_for_resolution_note_really_long_text( integration = make_alert_receive_channel(organization) alert_group = make_alert_group(integration) - channel = "potato" ts = 88945.4849 thread_ts = 16789.123 - make_slack_message(alert_group, slack_id=thread_ts, channel_id=channel) + slack_channel = make_slack_channel(slack_team_identity) + slack_channel_id = slack_channel.slack_id + + make_slack_message(alert_group, slack_id=thread_ts, channel_id=slack_channel_id) mock_permalink = "http://example.com" @@ -243,7 +246,7 @@ def test_save_thread_message_for_resolution_note_really_long_text( payload = { "event": { - "channel": channel, + "channel": slack_channel_id, "ts": ts, "thread_ts": thread_ts, "text": "h" * 2901, @@ -272,6 +275,7 @@ def test_save_thread_message_for_resolution_note_api_errors( make_alert_receive_channel, make_alert_group, make_slack_message, + make_slack_channel, ) -> None: ( organization, @@ -282,11 +286,13 @@ def test_save_thread_message_for_resolution_note_api_errors( integration = make_alert_receive_channel(organization) alert_group = make_alert_group(integration) - channel = "potato" ts = 88945.4849 thread_ts = 16789.123 - make_slack_message(alert_group, slack_id=thread_ts, channel_id=channel) + slack_channel = make_slack_channel(slack_team_identity) + slack_channel_id = slack_channel.slack_id + + make_slack_message(alert_group, slack_id=thread_ts, channel_id=slack_channel_id) step = SlackChannelMessageEventStep(slack_team_identity, organization, user) step._slack_client = Mock() @@ -296,7 +302,7 @@ def test_save_thread_message_for_resolution_note_api_errors( payload = { "event": { - "channel": channel, + "channel": slack_channel_id, "ts": ts, "thread_ts": thread_ts, "text": "h" * 2901, @@ -318,6 +324,7 @@ def test_save_thread_message_for_resolution_note( make_alert_receive_channel, make_alert_group, make_slack_message, + make_slack_channel, make_resolution_note_slack_message, resolution_note_slack_message_already_exists, ) -> None: @@ -332,12 +339,13 @@ def test_save_thread_message_for_resolution_note( original_text = "original text" new_text = "new text" - - channel = "potato" ts = 88945.4849 thread_ts = 16789.123 - make_slack_message(alert_group, slack_id=thread_ts, channel_id=channel) + slack_channel = make_slack_channel(slack_team_identity) + slack_channel_id = slack_channel.slack_id + + make_slack_message(alert_group, slack_id=thread_ts, channel_id=slack_channel_id) resolution_note_slack_message = None if resolution_note_slack_message_already_exists: @@ -353,7 +361,7 @@ def test_save_thread_message_for_resolution_note( payload = { "event": { - "channel": channel, + "channel": slack_channel_id, "ts": ts, "thread_ts": thread_ts, "text": new_text,