mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 03:57:06 -04:00
test: note length check works on note creation
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
b1c1837dc5
commit
66c02a3875
3 changed files with 71 additions and 0 deletions
|
@ -126,6 +126,19 @@ describe('Notes', () => {
|
|||
.expect('Content-Type', /json/)
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
it('fails with a content, that is too long', async () => {
|
||||
const content = 'x'.repeat(
|
||||
(testSetup.configService.get('noteConfig')
|
||||
.maxDocumentLength as number) + 1,
|
||||
);
|
||||
await agent
|
||||
.post('/api/private/notes/test2')
|
||||
.set('Content-Type', 'text/markdown')
|
||||
.send(content)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(413);
|
||||
});
|
||||
});
|
||||
|
||||
describe('DELETE /notes/{note}', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue