MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / step5_postThread

Function step5_postThread

apps/web/__tests__/invites.test.ts:344–370  ·  view source on GitHub ↗
(store: storeType)

Source from the content-addressed store, hash-verified

342}
343
344async function step5_postThread(store: storeType) {
345 await testApiHandler({
346 handler: handlerThreads as any,
347 url: `/api/threads`,
348 test: async ({ fetch }) => {
349 const response = await fetch({
350 method: 'POST',
351 headers: {
352 'Content-Type': 'application/json',
353 Authorization: `Bearer ${store.invited.token}`,
354 Host: store.domain.host,
355 Origin: store.domain.origin,
356 },
357 body: JSON.stringify({
358 accountId: store.account.id,
359 channelId: store.channel.id,
360 body: 'hello',
361 }),
362 });
363 expect(response.status).toEqual(200);
364 expect(response.json()).resolves.toMatchObject({
365 thread: expect.any(Object),
366 });
367 // expect(eventNewThreadMock).toBeCalledTimes(1);
368 },
369 });
370}

Callers 1

invites.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected