mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -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
5275f6b876
commit
9bf85a671d
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