mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fixed unit tests
This commit is contained in:
parent
df60b120c8
commit
e8528ccbb8
@ -10,11 +10,20 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
|||||||
userCount: 4,
|
userCount: 4,
|
||||||
userList: [
|
userList: [
|
||||||
{
|
{
|
||||||
userId: 1,
|
userId: 4,
|
||||||
firstName: 'Bibi',
|
firstName: 'New',
|
||||||
lastName: 'Bloxberg',
|
lastName: 'User',
|
||||||
email: 'bibi@bloxberg.de',
|
email: 'new@user.ch',
|
||||||
creation: [200, 400, 600],
|
creation: [1000, 1000, 1000],
|
||||||
|
emailChecked: false,
|
||||||
|
deletedAt: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userId: 3,
|
||||||
|
firstName: 'Peter',
|
||||||
|
lastName: 'Lustig',
|
||||||
|
email: 'peter@lustig.de',
|
||||||
|
creation: [0, 0, 0],
|
||||||
emailChecked: true,
|
emailChecked: true,
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
},
|
},
|
||||||
@ -28,23 +37,14 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
|||||||
deletedAt: new Date(),
|
deletedAt: new Date(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
userId: 3,
|
userId: 1,
|
||||||
firstName: 'Peter',
|
firstName: 'Bibi',
|
||||||
lastName: 'Lustig',
|
lastName: 'Bloxberg',
|
||||||
email: 'peter@lustig.de',
|
email: 'bibi@bloxberg.de',
|
||||||
creation: [0, 0, 0],
|
creation: [200, 400, 600],
|
||||||
emailChecked: true,
|
emailChecked: true,
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
userId: 4,
|
|
||||||
firstName: 'New',
|
|
||||||
lastName: 'User',
|
|
||||||
email: 'new@user.ch',
|
|
||||||
creation: [1000, 1000, 1000],
|
|
||||||
emailChecked: false,
|
|
||||||
deletedAt: null,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -79,9 +79,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: '',
|
query: '',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: null,
|
byActivated: null,
|
||||||
byDeleted: null,
|
byDeleted: null,
|
||||||
@ -100,9 +101,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: '',
|
query: '',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: false,
|
byActivated: false,
|
||||||
byDeleted: null,
|
byDeleted: null,
|
||||||
@ -122,9 +124,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: '',
|
query: '',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: null,
|
byActivated: null,
|
||||||
byDeleted: true,
|
byDeleted: true,
|
||||||
@ -144,9 +147,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: '',
|
query: '',
|
||||||
currentPage: 2,
|
currentPage: 2,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: null,
|
byActivated: null,
|
||||||
byDeleted: null,
|
byDeleted: null,
|
||||||
@ -166,9 +170,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: 'search string',
|
query: 'search string',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: null,
|
byActivated: null,
|
||||||
byDeleted: null,
|
byDeleted: null,
|
||||||
@ -185,9 +190,10 @@ describe('UserSearch', () => {
|
|||||||
expect(apolloQueryMock).toBeCalledWith(
|
expect(apolloQueryMock).toBeCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
variables: {
|
variables: {
|
||||||
searchText: '',
|
query: '',
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
order: 'DESC',
|
||||||
filters: {
|
filters: {
|
||||||
byActivated: null,
|
byActivated: null,
|
||||||
byDeleted: null,
|
byDeleted: null,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user