aboutsummaryrefslogtreecommitdiffstats
path: root/src/services/graphql/mutators/send-email.test.ts
blob: dbba7ad5f24d706a6c334927fb81573abdebc222 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { describe, expect, it } from '@jest/globals';
import { type SendEmailInput, sendEmail } from './send-email';

describe('send-email', () => {
  it('successfully sends an email', async () => {
    const email: SendEmailInput = {
      body: 'Natus soluta et.',
      clientMutationId: 'qui',
      replyTo: 'Nina.Jerde@example.net',
      subject: 'quaerat odio veritatis',
    };
    const result = await sendEmail(email);

    // eslint-disable-next-line @typescript-eslint/no-magic-numbers
    expect.assertions(5);

    expect(result.clientMutationId).toBe(email.clientMutationId);
    expect(result.message).toBeDefined();
    expect(result.origin).toBeDefined();
    expect(result.replyTo).toBe(email.replyTo);
    expect(result.sent).toBe(true);
  });
});