test new queryParamToBool helper

This commit is contained in:
lesion 2023-06-18 22:17:34 +02:00
parent d7f1dd686c
commit 64c9c8a0e8
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -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 () => {