diff --git a/tests/app.test.js b/tests/app.test.js index 44d1d081..a19201a3 100644 --- a/tests/app.test.js +++ b/tests/app.test.js @@ -223,6 +223,27 @@ describe('Events', () => { expect(response.body.title).toBe('test title 4') expect(response.body.tags[0]).toBe('test tag') }) + + + test('should sanitize htlm in description', async () => { + const event = { + title: 'test title', + place_id: places[0], + start_datetime: dayjs().unix() + 1000, + tags: ['test tags'], + description: `

inside paragraph

link with fb reference` + } + + + const response = await request(app).post('/api/event') + .send(event) + .expect(200) + .expect('Content-Type', /json/) + + expect(response.body.description).toBe(`

inside paragraph

link with fb reference`) + + }) + }) let event = {}