From 5e07e9fc6e6f83903b606631f6aa7fc10141227e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Jun 2026 03:23:26 +1200 Subject: [PATCH] test(messaging): cover enabling SES provider with empty fromEmail Regression test for the enable-guard fix: PATCH {enabled:true} on an SES provider whose fromEmail is still empty must return 400 provider_missing_credentials rather than enabling a provider that would fail every send at the AWS API. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/e2e/Services/Messaging/MessagingBase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/e2e/Services/Messaging/MessagingBase.php b/tests/e2e/Services/Messaging/MessagingBase.php index 163f11ff21..c291dd94c9 100644 --- a/tests/e2e/Services/Messaging/MessagingBase.php +++ b/tests/e2e/Services/Messaging/MessagingBase.php @@ -1105,6 +1105,14 @@ trait MessagingBase $this->assertEquals('my-access-key', $updateResponse['body']['credentials']['accessKey']); $this->assertEquals('my-secret-key', $updateResponse['body']['credentials']['secretKey']); + // Regression: enabling while fromEmail is still empty must be rejected, not silently enabled. + $enableWithoutFromEmail = $this->client->call(Client::METHOD_PATCH, '/messaging/providers/ses/' . $providerId, $headers, [ + 'enabled' => true, + ]); + + $this->assertEquals(400, $enableWithoutFromEmail['headers']['status-code']); + $this->assertEquals('provider_missing_credentials', $enableWithoutFromEmail['body']['type']); + // Enable the first provider once fromEmail is supplied. $enableResponse = $this->client->call(Client::METHOD_PATCH, '/messaging/providers/ses/' . $providerId, $headers, [ 'fromEmail' => 'sender-email@my-domain.com',