mirror of
https://github.com/directus/directus.git
synced 2026-01-13 18:18:17 -05:00
25 lines
629 B
TypeScript
25 lines
629 B
TypeScript
import jestOpenAPI from 'jest-openapi';
|
|
import axios from 'axios';
|
|
import path from 'path';
|
|
import { api } from './api';
|
|
|
|
jestOpenAPI(path.join(__dirname, 'openapi.json'));
|
|
|
|
describe('Mail', function () {
|
|
it('POST /mail', async function () {
|
|
const res = await axios.post(`${api}/mail?access_token=admin`, {
|
|
to: ['user@example.com', 'admin@example.com'],
|
|
subject: 'New Password',
|
|
body: 'Hello <b>{{name}}</b>, this is your new password: {{password}}.',
|
|
type: 'html',
|
|
data: {
|
|
name: 'John Doe',
|
|
password: 'secret',
|
|
},
|
|
});
|
|
|
|
expect(res.status).toEqual(200);
|
|
expect(res).toSatisfyApiSpec();
|
|
});
|
|
});
|