diff --git a/admin/src/components/UserTable.spec.js b/admin/src/components/UserTable.spec.js index e25f53015..91c98077f 100644 --- a/admin/src/components/UserTable.spec.js +++ b/admin/src/components/UserTable.spec.js @@ -6,28 +6,221 @@ const localVue = global.localVue describe('UserTable', () => { let wrapper - const propsData = { - type: 'Type', - itemsUser: [], - fieldsTable: [], - creation: [], + const propsDataPageUserSearch = { + type: 'PageUserSearch', + itemsUser: [ + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + ], + fieldsTable: ['email', 'firstName', 'lastName', 'creation'], + } + + const propsDataUserListSearch = { + type: 'UserListSearch', + itemsUser: [ + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + ], + fieldsTable: ['email', 'firstName', 'lastName', 'creation'], + creation: [1000, 1000, 1000], + } + + const propsDataUserListMassCreation = { + type: 'UserListMassCreation', + itemsUser: [ + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + creation: [1000, 1000, 1000], + }, + ], + fieldsTable: ['email', 'firstName', 'lastName', 'creation'], + creation: [1000, 1000, 1000], + } + + const propsDataPageCreationConfirm = { + type: 'PageCreationConfirm', + itemsUser: [ + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + amount: 10, + memo: 'Test 1', + date: '11-09-2001', + moderator: 1, + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + amount: 10, + memo: 'Test 2', + date: '21-09-2001', + moderator: 1, + }, + { + email: 'bibi@bloxberg.de', + firstName: 'Bibi', + lastName: 'Bloxberg', + amount: 10, + memo: 'Test 3', + date: '30-09-2001', + moderator: 1, + }, + ], + fieldsTable: ['email', 'firstName', 'lastName', 'amount', 'memo', 'date', 'moderator'], } const mocks = { $t: jest.fn((t) => t), } - const Wrapper = () => { + const Wrapper = (propsData) => { return mount(UserTable, { localVue, propsData, mocks }) } describe('mount', () => { - beforeEach(() => { - wrapper = Wrapper() + describe('type PageUserSearch', () => { + beforeEach(() => { + wrapper = Wrapper(propsDataPageUserSearch) + }) + + it('has a DIV element with the class.component-user-table', () => { + expect(wrapper.find('.component-user-table').exists()).toBeTruthy() + }) + + it('expect(wrapper.html()).', () => { + // eslint-disable-next-line no-console + console.log(wrapper.html()) + }) }) - it('has a DIV element with the class.component-user-table', () => { - expect(wrapper.find('.component-user-table').exists()).toBeTruthy() + describe('type UserListSearch', () => { + beforeEach(() => { + wrapper = Wrapper(propsDataUserListSearch) + }) + + it('has a DIV element with the class.component-user-table', () => { + expect(wrapper.find('.component-user-table').exists()).toBeTruthy() + }) + + it('expect(wrapper.html()).', () => { + // eslint-disable-next-line no-console + console.log(wrapper.html()) + }) }) + + describe('type UserListMassCreation', () => { + beforeEach(() => { + wrapper = Wrapper(propsDataUserListMassCreation) + }) + + it('has a DIV element with the class.component-user-table', () => { + expect(wrapper.find('.component-user-table').exists()).toBeTruthy() + }) + + it('expect(wrapper.html()).', () => { + // eslint-disable-next-line no-console + console.log(wrapper.html()) + }) + }) + + describe('type PageCreationConfirm', () => { + beforeEach(() => { + wrapper = Wrapper(propsDataPageCreationConfirm) + }) + + it('has a DIV element with the class.component-user-table', () => { + expect(wrapper.find('.component-user-table').exists()).toBeTruthy() + }) + + it('expect(wrapper.html()).', () => { + // eslint-disable-next-line no-console + console.log(wrapper.html()) + }) + }) + /** + + + + + + + + */ }) })