From 3f0b4d88af81f712e2a648fa2240f0d9041d7279 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 29 Jun 2023 16:28:33 +0200 Subject: [PATCH] test user query --- admin/src/pages/CreationConfirm.spec.js | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/admin/src/pages/CreationConfirm.spec.js b/admin/src/pages/CreationConfirm.spec.js index c1c823761..9e1ddb4a4 100644 --- a/admin/src/pages/CreationConfirm.spec.js +++ b/admin/src/pages/CreationConfirm.spec.js @@ -456,6 +456,40 @@ describe('CreationConfirm', () => { }) }) + describe('user query', () => { + describe('with user query', () => { + beforeEach(() => { + wrapper.findComponent({ name: 'UserQuery' }).vm.$emit('input', 'query') + }) + + it('calls the API with query', () => { + expect(adminListContributionsMock).toBeCalledWith({ + currentPage: 1, + order: 'DESC', + pageSize: 25, + query: 'query', + statusFilter: ['IN_PROGRESS', 'PENDING'], + }) + }) + + describe('reset query', () => { + beforeEach(() => { + wrapper.findComponent({ name: 'UserQuery' }).vm.$emit('input', '') + }) + + it('calls the API with empty query', () => { + expect(adminListContributionsMock).toBeCalledWith({ + currentPage: 1, + order: 'DESC', + pageSize: 25, + query: '', + statusFilter: ['IN_PROGRESS', 'PENDING'], + }) + }) + }) + }) + }) + describe('update status', () => { beforeEach(async () => { await wrapper.findComponent({ name: 'OpenCreationsTable' }).vm.$emit('update-status', 2)