From 723cfe1fba6bd398bc255593b65cc6deccf2b11c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 1 Feb 2022 18:06:53 +0100 Subject: [PATCH] test with selected items in store --- admin/src/pages/Creation.spec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/admin/src/pages/Creation.spec.js b/admin/src/pages/Creation.spec.js index 9dd784097..c74e7070b 100644 --- a/admin/src/pages/Creation.spec.js +++ b/admin/src/pages/Creation.spec.js @@ -240,6 +240,35 @@ describe('Creation', () => { }) }) + describe('store has items in userSelectedInMassCreation', () => { + beforeEach(() => { + mocks.$store.state.userSelectedInMassCreation = [ + { + userId: 2, + firstName: 'Benjamin', + lastName: 'Blümchen', + email: 'benjamin@bluemchen.de', + creation: [800, 600, 400], + showDetails: false, + }, + ] + wrapper = Wrapper() + }) + + it('has only one item itemsList', () => { + expect(wrapper.vm.itemsList).toEqual([ + { + userId: 1, + firstName: 'Bibi', + lastName: 'Bloxberg', + email: 'bibi@bloxberg.de', + creation: [200, 400, 600], + showDetails: false, + }, + ]) + }) + }) + describe('watchers', () => { beforeEach(() => { jest.clearAllMocks()