Fails if note id is empty

Signed-off-by: Tamotsu Takahashi <ttakah+github@gmail.com>
This commit is contained in:
TAKAHASHI Tamotsu 2022-10-14 15:27:19 +09:00 committed by David Mehren
parent be04b2d005
commit 5704ad9c3b

View file

@ -30,6 +30,13 @@ describe('extract note id from path', () => {
expect(() => extractNoteIdFromRequestUrl(mockedRequest)).toThrow();
});
it('fails if note id is empty', () => {
const mockedRequest = Mock.of<IncomingMessage>({
url: '/realtime?noteId=',
});
expect(() => extractNoteIdFromRequestUrl(mockedRequest)).toThrow();
});
it('fails if path is empty', () => {
const mockedRequest = Mock.of<IncomingMessage>({
url: '',