test new queryParamToBool helper

This commit is contained in:
lesion
2023-06-18 22:17:34 +02:00
parent d7f1dd686c
commit 64c9c8a0e8

View File

@@ -239,9 +239,9 @@ describe('Events', () => {
.send(event) .send(event)
.expect(200) .expect(200)
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
expect(response.body.description).toBe(`<p>inside paragraph</p><a href="https://test.com/?query=true">link with fb reference</a>`) expect(response.body.description).toBe(`<p>inside paragraph</p><a href="https://test.com/?query=true">link with fb reference</a>`)
}) })
}) })
@@ -384,7 +384,7 @@ describe('Collection', () => {
}) })
test('shoud get collection\'s filters using withFilters parameter', async () => { test('shoud get collection\'s filters using withFilters parameter', async () => {
const response = await request(app) let response = await request(app)
.get('/api/collections?withFilters=true') .get('/api/collections?withFilters=true')
.expect(200) .expect(200)
@@ -393,6 +393,18 @@ describe('Collection', () => {
expect(response.body[0].filters.length).toBe(1) expect(response.body[0].filters.length).toBe(1)
expect(response.body[0].filters[0].tags.length).toBe(1) expect(response.body[0].filters[0].tags.length).toBe(1)
expect(response.body[0].filters[0].tags[0]).toBe('test') expect(response.body[0].filters[0].tags[0]).toBe('test')
response = await request(app)
.get('/api/collections')
.expect(200)
expect(response.body[0].filters).toBeUndefined()
response = await request(app)
.get('/api/collections?withFilters=false')
.expect(200)
expect(response.body[0].filters).toBeUndefined()
}) })
test('should get collection events', async () => { test('should get collection events', async () => {