Skip to content

Commit

Permalink
patch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickobedgiu1 committed Jul 3, 2024
1 parent 0424115 commit 25622bf
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions tests/Integration/WhatsAppCloudApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,17 @@ public function test_send_reply_buttons()

public function test_send_reaction_message()
{
$this->markTestIncomplete(
'This test should use a real message ID.'
$textMessage = $this->whatsapp_app_cloud_api->sendTextMessage(
WhatsAppCloudApiTestConfiguration::$to_phone_number_id,
'This text will receive a reaction',
true
);

$messageId = $textMessage->decodedBody()['messages'][0]['id'];

$response = $this->whatsapp_app_cloud_api->sendReaction(
WhatsAppCloudApiTestConfiguration::$to_phone_number_id,
'wamid.HBgMMjU2NzQyMDMwNDAzFQIAERgSMEU2MkE3Q0I3RTEyRDU5NzIwAA==',
$messageId,
'👍'
);

Expand All @@ -319,13 +323,25 @@ public function test_send_reaction_message()

public function test_send_remove_reaction_message()
{
$this->markTestIncomplete(
'This test should use a real message ID.'
$textMessage = $this->whatsapp_app_cloud_api->sendTextMessage(
WhatsAppCloudApiTestConfiguration::$to_phone_number_id,
'This text will receive a reaction and then the reaction will be removed',
true
);

$messageId = $textMessage->decodedBody()['messages'][0]['id'];

$reactToMessage = $this->whatsapp_app_cloud_api->sendReaction(
WhatsAppCloudApiTestConfiguration::$to_phone_number_id,
$messageId,
'👍'
);

// sleep(3); // can delay next request to see reaction

$response = $this->whatsapp_app_cloud_api->sendReaction(
WhatsAppCloudApiTestConfiguration::$to_phone_number_id,
'wamid.HBgMMjU2NzQyMDMwNDAzFQIAERgSMEU2MkE3Q0I3RTEyRDU5NzIwAA=='
$messageId
);

$this->assertEquals(200, $response->httpStatusCode());
Expand Down

0 comments on commit 25622bf

Please sign in to comment.