import tap from 'tap'
import sinon from 'sinon'
import { application } from 'application.js'
{{#if shouldBeAuthenticated}}
import { authenticateUserTest } from '__test__/utils/authenticateUserTest.js'
{{/if}}
import prisma from 'tools/database/prisma.js'
await tap.test('{{httpMethod}} {{url}}', async (t) => {
t.afterEach(() => {
sinon.restore()
})
await t.test('succeeds', async (t) => {
const { accessToken } = await authenticateUserTest()
sinon.stub(prisma, 'channel').value({
findFirst: async () => {
return null
}
const response = await application.inject({
method: '{{httpMethod}}',
url: '{{url}}',
headers: {
authorization: `Bearer ${accessToken}`
},
payload: {}
// const responseJson = response.json()
t.equal(response.statusCode, 200)