-
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.
- Loading branch information
Showing
3 changed files
with
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import RedirectController from '../../src/controllers/redirectController' | ||
import { beforeEach, describe, expect, it } from '@jest/globals' | ||
import { getMockReq, getMockRes } from '@jest-mock/express' | ||
|
||
const { res, mockClear } = getMockRes() | ||
|
||
beforeEach(() => { | ||
mockClear() | ||
}) | ||
|
||
describe('sep21', () => { | ||
it('should return a redirect to notion', async () => { | ||
const req = getMockReq() | ||
|
||
await RedirectController.sept21(req, res) | ||
|
||
expect(res.redirect) | ||
.toHaveBeenCalledWith(RedirectController.sept21Url) | ||
}) | ||
}) |
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,12 @@ | ||
import { type Request, type Response } from 'express' | ||
|
||
export default class RedirectController { | ||
static PATHS = { | ||
sept21: '/sep21', | ||
} | ||
static sept21Url = 'https://ginger-flood-c72.notion.site/The-2023-Celebration-of-Rachel-s-32nd-Birthday-Also-Known-As-Halloween-in-September-a17c5537f8594c30bb301a48c988f7ec' | ||
|
||
static async sept21 (_req: Request, res: Response): Promise<void> { | ||
res.redirect(RedirectController.sept21Url) | ||
} | ||
} |
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