-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an empty route for a form to change authors on a PREreview
Refs #388
- Loading branch information
1 parent
23e1f57
commit 1492653
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { notFound } from '../middleware' | ||
|
||
export const writeReviewChangeAuthor = () => notFound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as E from 'fp-ts/Either' | ||
import { MediaType, Status } from 'hyper-ts' | ||
import * as _ from '../../src/write-review' | ||
import * as fc from '../fc' | ||
import { runMiddleware } from '../middleware' | ||
|
||
test('writeReviewChangeAuthor', async () => { | ||
await fc.assert( | ||
fc.asyncProperty(fc.connection({}), async connection => { | ||
const actual = await runMiddleware(_.writeReviewChangeAuthor()({}), connection)() | ||
|
||
expect(actual).toStrictEqual( | ||
E.right([ | ||
{ type: 'setStatus', status: Status.NotFound }, | ||
{ type: 'setHeader', name: 'Cache-Control', value: 'no-store, must-revalidate' }, | ||
{ type: 'setHeader', name: 'Content-Type', value: MediaType.textHTML }, | ||
{ type: 'setBody', body: expect.anything() }, | ||
]), | ||
) | ||
}), | ||
) | ||
}) |