11import { fireEvent , render , screen } from '@testing-library/react' ;
22import { MemoryRouter } from 'react-router-dom' ;
33import { mockAccountNotifications } from '../__mocks__/notifications-mocks' ;
4- import { mockSettings } from '../__mocks__/state-mocks' ;
4+ import { mockAuth , mockSettings } from '../__mocks__/state-mocks' ;
55import { AppContext } from '../context/App' ;
66import { IconColor } from '../types' ;
77import * as comms from '../utils/comms' ;
@@ -27,8 +27,9 @@ describe('components/Sidebar.tsx', () => {
2727 const tree = render (
2828 < AppContext . Provider
2929 value = { {
30- settings : mockSettings ,
3130 notifications : mockAccountNotifications ,
31+ auth : mockAuth ,
32+ settings : mockSettings ,
3233 } }
3334 >
3435 < MemoryRouter >
@@ -46,6 +47,7 @@ describe('components/Sidebar.tsx', () => {
4647 value = { {
4748 isLoggedIn : false ,
4849 notifications : mockAccountNotifications ,
50+ auth : mockAuth ,
4951 settings : mockSettings ,
5052 } }
5153 >
@@ -61,7 +63,12 @@ describe('components/Sidebar.tsx', () => {
6163 it ( 'should open the gitify repository' , ( ) => {
6264 render (
6365 < AppContext . Provider
64- value = { { isLoggedIn : false , notifications : [ ] , settings : mockSettings } }
66+ value = { {
67+ isLoggedIn : false ,
68+ notifications : [ ] ,
69+ auth : mockAuth ,
70+ settings : mockSettings ,
71+ } }
6572 >
6673 < MemoryRouter >
6774 < Sidebar />
@@ -85,6 +92,7 @@ describe('components/Sidebar.tsx', () => {
8592 value = { {
8693 isLoggedIn : true ,
8794 notifications : [ ] ,
95+ auth : mockAuth ,
8896 settings : mockSettings ,
8997 } }
9098 >
@@ -114,6 +122,7 @@ describe('components/Sidebar.tsx', () => {
114122 value = { {
115123 isLoggedIn : true ,
116124 notifications : mockAccountNotifications ,
125+ auth : mockAuth ,
117126 settings : mockSettings ,
118127 } }
119128 >
@@ -146,6 +155,7 @@ describe('components/Sidebar.tsx', () => {
146155 value = { {
147156 isLoggedIn : true ,
148157 notifications : mockAccountNotifications ,
158+ auth : mockAuth ,
149159 settings : mockSettings ,
150160 } }
151161 >
@@ -169,6 +179,7 @@ describe('components/Sidebar.tsx', () => {
169179 value = { {
170180 isLoggedIn : true ,
171181 notifications : mockAccountNotifications ,
182+ auth : mockAuth ,
172183 settings : mockSettings ,
173184 } }
174185 >
@@ -193,6 +204,7 @@ describe('components/Sidebar.tsx', () => {
193204 value = { {
194205 isLoggedIn : true ,
195206 notifications : [ ] ,
207+ auth : mockAuth ,
196208 settings : mockSettings ,
197209 fetchNotifications,
198210 status : 'success' ,
@@ -215,6 +227,7 @@ describe('components/Sidebar.tsx', () => {
215227 value = { {
216228 isLoggedIn : true ,
217229 notifications : [ ] ,
230+ auth : mockAuth ,
218231 settings : mockSettings ,
219232 fetchNotifications,
220233 status : 'loading' ,
@@ -239,6 +252,7 @@ describe('components/Sidebar.tsx', () => {
239252 value = { {
240253 isLoggedIn : true ,
241254 notifications : [ ] ,
255+ auth : mockAuth ,
242256 settings : mockSettings ,
243257 } }
244258 >
@@ -257,6 +271,7 @@ describe('components/Sidebar.tsx', () => {
257271 value = { {
258272 isLoggedIn : true ,
259273 notifications : [ ] ,
274+ auth : mockAuth ,
260275 settings : mockSettings ,
261276 } }
262277 >
@@ -277,6 +292,7 @@ describe('components/Sidebar.tsx', () => {
277292 value = { {
278293 isLoggedIn : true ,
279294 notifications : [ ] ,
295+ auth : mockAuth ,
280296 settings : mockSettings ,
281297 } }
282298 >
@@ -297,6 +313,7 @@ describe('components/Sidebar.tsx', () => {
297313 value = { {
298314 isLoggedIn : true ,
299315 notifications : [ ] ,
316+ auth : mockAuth ,
300317 settings : mockSettings ,
301318 fetchNotifications,
302319 } }
@@ -322,6 +339,7 @@ describe('components/Sidebar.tsx', () => {
322339 value = { {
323340 isLoggedIn : true ,
324341 notifications : mockAccountNotifications ,
342+ auth : mockAuth ,
325343 settings : mockSettings ,
326344 } }
327345 >
@@ -345,6 +363,7 @@ describe('components/Sidebar.tsx', () => {
345363 value = { {
346364 isLoggedIn : true ,
347365 notifications : mockAccountNotifications ,
366+ auth : mockAuth ,
348367 settings : mockSettings ,
349368 } }
350369 >
@@ -368,6 +387,7 @@ describe('components/Sidebar.tsx', () => {
368387 value = { {
369388 isLoggedIn : true ,
370389 notifications : mockAccountNotifications ,
390+ auth : mockAuth ,
371391 settings : mockSettings ,
372392 } }
373393 >
@@ -388,7 +408,12 @@ describe('components/Sidebar.tsx', () => {
388408
389409 render (
390410 < AppContext . Provider
391- value = { { isLoggedIn : false , notifications : [ ] , settings : mockSettings } }
411+ value = { {
412+ isLoggedIn : false ,
413+ notifications : [ ] ,
414+ auth : mockAuth ,
415+ settings : mockSettings ,
416+ } }
392417 >
393418 < MemoryRouter >
394419 < Sidebar />
@@ -406,7 +431,12 @@ describe('components/Sidebar.tsx', () => {
406431
407432 render (
408433 < AppContext . Provider
409- value = { { isLoggedIn : false , notifications : [ ] , settings : mockSettings } }
434+ value = { {
435+ isLoggedIn : false ,
436+ notifications : [ ] ,
437+ auth : mockAuth ,
438+ settings : mockSettings ,
439+ } }
410440 >
411441 < MemoryRouter >
412442 < Sidebar />
@@ -427,6 +457,7 @@ describe('components/Sidebar.tsx', () => {
427457 value = { {
428458 isLoggedIn : true ,
429459 notifications : [ ] ,
460+ auth : mockAuth ,
430461 settings : mockSettings ,
431462 } }
432463 >
@@ -448,6 +479,7 @@ describe('components/Sidebar.tsx', () => {
448479 value = { {
449480 isLoggedIn : true ,
450481 notifications : mockAccountNotifications ,
482+ auth : mockAuth ,
451483 settings : mockSettings ,
452484 } }
453485 >
0 commit comments