Skip to content

Commit 75c7007

Browse files
committed
RI-6336 - removed poluted object for testing
1 parent e1f16e4 commit 75c7007

File tree

1 file changed

+73
-48
lines changed

1 file changed

+73
-48
lines changed

redisinsight/ui/src/slices/tests/browser/list.spec.ts

Lines changed: 73 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ describe('list slice', () => {
8383
const nextState = reducer(initialState, setListInitialState())
8484

8585
// Assert
86-
const rootState = Object.assign(initialStateDefault, {
86+
const rootState = {
87+
...initialStateDefault,
8788
browser: { list: nextState },
88-
})
89+
}
8990
expect(listSelector(rootState)).toEqual(state)
9091
})
9192
})
@@ -102,9 +103,10 @@ describe('list slice', () => {
102103
const nextState = reducer(initialState, loadListElements())
103104

104105
// Assert
105-
const rootState = Object.assign(initialStateDefault, {
106+
const rootState = {
107+
...initialStateDefault,
106108
browser: { list: nextState },
107-
})
109+
}
108110
expect(listSelector(rootState)).toEqual(state)
109111
})
110112
})
@@ -136,9 +138,10 @@ describe('list slice', () => {
136138
const nextState = reducer(initialState, loadListElementsSuccess(data))
137139

138140
// Assert
139-
const rootState = Object.assign(initialStateDefault, {
141+
const rootState = {
142+
...initialStateDefault,
140143
browser: { list: nextState },
141-
})
144+
}
142145
expect(listSelector(rootState)).toEqual(state)
143146
})
144147
})
@@ -157,9 +160,10 @@ describe('list slice', () => {
157160
const nextState = reducer(initialState, loadListElementsFailure(data))
158161

159162
// Assert
160-
const rootState = Object.assign(initialStateDefault, {
163+
const rootState = {
164+
...initialStateDefault,
161165
browser: { list: nextState },
162-
})
166+
}
163167
expect(listSelector(rootState)).toEqual(state)
164168
})
165169
})
@@ -177,9 +181,10 @@ describe('list slice', () => {
177181
const nextState = reducer(initialState, loadMoreListElements())
178182

179183
// Assert
180-
const rootState = Object.assign(initialStateDefault, {
184+
const rootState = {
185+
...initialStateDefault,
181186
browser: { list: nextState },
182-
})
187+
}
183188
expect(listSelector(rootState)).toEqual(state)
184189
})
185190
})
@@ -220,9 +225,10 @@ describe('list slice', () => {
220225
)
221226

222227
// Assert
223-
const rootState = Object.assign(initialStateDefault, {
228+
const rootState = {
229+
...initialStateDefault,
224230
browser: { list: nextState },
225-
})
231+
}
226232
expect(listSelector(rootState)).toEqual(state)
227233
})
228234

@@ -241,9 +247,10 @@ describe('list slice', () => {
241247
)
242248

243249
// Assert
244-
const rootState = Object.assign(initialStateDefault, {
250+
const rootState = {
251+
...initialStateDefault,
245252
browser: { list: nextState },
246-
})
253+
}
247254
expect(listSelector(rootState)).toEqual(initialState)
248255
})
249256
})
@@ -265,9 +272,10 @@ describe('list slice', () => {
265272
)
266273

267274
// Assert
268-
const rootState = Object.assign(initialStateDefault, {
275+
const rootState = {
276+
...initialStateDefault,
269277
browser: { list: nextState },
270-
})
278+
}
271279
expect(listSelector(rootState)).toEqual(state)
272280
})
273281
})
@@ -288,9 +296,10 @@ describe('list slice', () => {
288296
const nextState = reducer(initialState, updateValue())
289297

290298
// Assert
291-
const rootState = Object.assign(initialStateDefault, {
299+
const rootState = {
300+
...initialStateDefault,
292301
browser: { list: nextState },
293-
})
302+
}
294303
expect(listSelector(rootState)).toEqual(state)
295304
})
296305
})
@@ -311,9 +320,10 @@ describe('list slice', () => {
311320
const nextState = reducer(initialState, updateValueSuccess())
312321

313322
// Assert
314-
const rootState = Object.assign(initialStateDefault, {
323+
const rootState = {
324+
...initialStateDefault,
315325
browser: { list: nextState },
316-
})
326+
}
317327
expect(listSelector(rootState)).toEqual(state)
318328
})
319329
})
@@ -335,9 +345,10 @@ describe('list slice', () => {
335345
const nextState = reducer(initialState, updateValueFailure(data))
336346

337347
// Assert
338-
const rootState = Object.assign(initialStateDefault, {
348+
const rootState = {
349+
...initialStateDefault,
339350
browser: { list: nextState },
340-
})
351+
}
341352
expect(listSelector(rootState)).toEqual(state)
342353
})
343354
})
@@ -358,9 +369,10 @@ describe('list slice', () => {
358369
const nextState = reducer(initialState, resetUpdateValue())
359370

360371
// Assert
361-
const rootState = Object.assign(initialStateDefault, {
372+
const rootState = {
373+
...initialStateDefault,
362374
browser: { list: nextState },
363-
})
375+
}
364376
expect(listSelector(rootState)).toEqual(state)
365377
})
366378
})
@@ -386,9 +398,10 @@ describe('list slice', () => {
386398
)
387399

388400
// Assert
389-
const rootState = Object.assign(initialStateDefault, {
401+
const rootState = {
402+
...initialStateDefault,
390403
browser: { list: nextState },
391-
})
404+
}
392405
expect(listSelector(rootState)).toEqual(state)
393406
})
394407
})
@@ -418,9 +431,10 @@ describe('list slice', () => {
418431
)
419432

420433
// Assert
421-
const rootState = Object.assign(initialStateDefault, {
434+
const rootState = {
435+
...initialStateDefault,
422436
browser: { list: nextState },
423-
})
437+
}
424438
expect(listSelector(rootState)).toEqual(state)
425439
})
426440

@@ -447,9 +461,10 @@ describe('list slice', () => {
447461
)
448462

449463
// Assert
450-
const rootState = Object.assign(initialStateDefault, {
464+
const rootState = {
465+
...initialStateDefault,
451466
browser: { list: nextState },
452-
})
467+
}
453468
expect(listSelector(rootState)).toEqual(state)
454469
})
455470
})
@@ -471,9 +486,10 @@ describe('list slice', () => {
471486
)
472487

473488
// Assert
474-
const rootState = Object.assign(initialStateDefault, {
489+
const rootState = {
490+
...initialStateDefault,
475491
browser: { list: nextState },
476-
})
492+
}
477493
expect(listSelector(rootState)).toEqual(state)
478494
})
479495
})
@@ -492,9 +508,10 @@ describe('list slice', () => {
492508
)
493509

494510
// Assert
495-
const rootState = Object.assign(initialStateDefault, {
511+
const rootState = {
512+
...initialStateDefault,
496513
browser: { list: nextState },
497-
})
514+
}
498515
expect(listSelector(rootState)).toEqual(state)
499516
})
500517
})
@@ -513,9 +530,10 @@ describe('list slice', () => {
513530
)
514531

515532
// Assert
516-
const rootState = Object.assign(initialStateDefault, {
533+
const rootState = {
534+
...initialStateDefault,
517535
browser: { list: nextState },
518-
})
536+
}
519537
expect(listSelector(rootState)).toEqual(state)
520538
})
521539
})
@@ -537,9 +555,10 @@ describe('list slice', () => {
537555
)
538556

539557
// Assert
540-
const rootState = Object.assign(initialStateDefault, {
558+
const rootState = {
559+
...initialStateDefault,
541560
browser: { list: nextState },
542-
})
561+
}
543562
expect(listSelector(rootState)).toEqual(state)
544563
})
545564
})
@@ -558,9 +577,10 @@ describe('list slice', () => {
558577
)
559578

560579
// Assert
561-
const rootState = Object.assign(initialStateDefault, {
580+
const rootState = {
581+
...initialStateDefault,
562582
browser: { list: nextState },
563-
})
583+
}
564584
expect(listSelector(rootState)).toEqual(state)
565585
})
566586
})
@@ -579,9 +599,10 @@ describe('list slice', () => {
579599
)
580600

581601
// Assert
582-
const rootState = Object.assign(initialStateDefault, {
602+
const rootState = {
603+
...initialStateDefault,
583604
browser: { list: nextState },
584-
})
605+
}
585606
expect(listSelector(rootState)).toEqual(state)
586607
})
587608
})
@@ -603,9 +624,10 @@ describe('list slice', () => {
603624
)
604625

605626
// Assert
606-
const rootState = Object.assign(initialStateDefault, {
627+
const rootState = {
628+
...initialStateDefault,
607629
browser: { list: nextState },
608-
})
630+
}
609631
expect(listSelector(rootState)).toEqual(state)
610632
})
611633
})
@@ -812,8 +834,10 @@ describe('list slice', () => {
812834
it('succeed to delete elements from list', async () => {
813835
// Arrange
814836
const responsePayload = { status: 200, data: { elements: ['zx', 'zz'] } }
815-
const nextState = Object.assign(initialStateDefault, {
837+
const nextState = {
838+
...initialStateDefault,
816839
browser: {
840+
...initialStateDefault.browser,
817841
list: {
818842
...initialState,
819843
data: {
@@ -822,7 +846,7 @@ describe('list slice', () => {
822846
}
823847
}
824848
},
825-
})
849+
}
826850

827851
const mockedStore = mockStore(nextState)
828852

@@ -851,7 +875,8 @@ describe('list slice', () => {
851875
it('succeed to delete all elements from list', async () => {
852876
// Arrange
853877
const responsePayload = { status: 200 }
854-
const nextState = Object.assign(initialStateDefault, {
878+
const nextState = {
879+
...initialStateDefault,
855880
browser: {
856881
list: {
857882
...initialState,
@@ -861,7 +886,7 @@ describe('list slice', () => {
861886
}
862887
}
863888
},
864-
})
889+
}
865890

866891
const mockedStore = mockStore(nextState)
867892

0 commit comments

Comments
 (0)