Skip to content

Fix SMTP-log integration fixtures and make EmailLogEntity.log optional #42

Description

@ckenst

The SMTP-log integration tests currently create messages using PostMessageRequest and immediately query their SMTP logs:

  • GetMessageSmtpLogRequest.test.ts
  • GetInboxMessageSmtpLogRequest.test.ts

Messages created through the HTTP API do not pass through SMTP. For these messages, the API returns a successful response with an empty string:
{ "log": "" }
Both tests expect result.log to be an array, so they fail:

Expected: true
Received: false`
expect(Array.isArray(result?.log)).toBe(true);

For a message genuinely delivered through SMTP, the API returns the expected array:

{
  "log": [
    {
      "log": "Connection from: 192.0.2.1",
      "time": "0",
      "event": "SOCKET_OPEN"
    },
    {
      "time": "69",
      "event": "TLS_ACTIVE"
    },
    {
      "time": "174",
      "event": "SOCKET_CLOSED"
    }
  ]
}

This also shows that individual SMTP-log entries do not always include the inner log property. The current SDK model incorrectly declares it as required:

export class EmailLogEntity {
    log: string;
    time: string;
    event: string;
}

Expected behavior

The integration tests should query a known message that was delivered through SMTP, and the SDK type should accurately represent entries where the textual log value is absent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions