@@ -2,6 +2,7 @@ import { act, render, screen } from '@testing-library/react';
22import userEvent from '@testing-library/user-event' ;
33
44import {
5+ mockAuth ,
56 mockGitHubCloudAccount ,
67 mockSettings ,
78} from '../../__mocks__/state-mocks' ;
@@ -80,7 +81,7 @@ describe('renderer/components/notifications/AccountNotifications.tsx', () => {
8081 expect ( tree ) . toMatchSnapshot ( ) ;
8182 } ) ;
8283
83- it ( 'should render itself - account error' , async ( ) => {
84+ it ( 'should render itself - account error for single account ' , async ( ) => {
8485 const props = {
8586 account : mockGitHubCloudAccount ,
8687 notifications : [ ] ,
@@ -96,7 +97,37 @@ describe('renderer/components/notifications/AccountNotifications.tsx', () => {
9697
9798 await act ( async ( ) => {
9899 tree = render (
99- < AppContext . Provider value = { { settings : mockSettings } } >
100+ < AppContext . Provider
101+ value = { {
102+ auth : { accounts : [ mockGitHubCloudAccount ] } ,
103+ settings : mockSettings ,
104+ } }
105+ >
106+ < AccountNotifications { ...props } />
107+ </ AppContext . Provider > ,
108+ ) ;
109+ } ) ;
110+
111+ expect ( tree ) . toMatchSnapshot ( ) ;
112+ } ) ;
113+
114+ it ( 'should render itself - account error for multiple accounts' , async ( ) => {
115+ const props = {
116+ account : mockGitHubCloudAccount ,
117+ notifications : [ ] ,
118+ error : {
119+ title : 'Error title' ,
120+ descriptions : [ 'Error description' ] ,
121+ emojis : [ '🔥' ] ,
122+ } ,
123+ showAccountHeader : true ,
124+ } ;
125+
126+ let tree : ReturnType < typeof render > | null = null ;
127+
128+ await act ( async ( ) => {
129+ tree = render (
130+ < AppContext . Provider value = { { auth : mockAuth , settings : mockSettings } } >
100131 < AccountNotifications { ...props } />
101132 </ AppContext . Provider > ,
102133 ) ;
0 commit comments