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) <noreply@anthropic.com>
This commit is contained in:
Jake BarnbyandClaude Opus 4.8 committed 2026-06-03 03:23:26 +12:00
1 parent 1bfb0b115c
commit 5e07e9fc6e
1 file changed
+8
@@ -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',