File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,4 +208,31 @@ describe('AddDonation', () => {
208208 ) . toHaveValue ( 'Cool Designation Account (321)' ) ,
209209 ) ;
210210 } ) ;
211+
212+ it ( 'shows required-field errors after a field is touched' , async ( ) => {
213+ const { queryByText, findByText, getByRole } = render (
214+ < LocalizationProvider dateAdapter = { AdapterLuxon } >
215+ < ThemeProvider theme = { theme } >
216+ < SnackbarProvider >
217+ < GqlMockedProvider >
218+ < AddDonation
219+ accountListId = { accountListId }
220+ handleClose = { handleClose }
221+ />
222+ </ GqlMockedProvider >
223+ </ SnackbarProvider >
224+ </ ThemeProvider >
225+ </ LocalizationProvider > ,
226+ ) ;
227+ expect ( await findByText ( 'Amount' ) ) . toBeInTheDocument ( ) ;
228+ expect ( queryByText ( 'Partner Account is required' ) ) . not . toBeInTheDocument ( ) ;
229+
230+ const partnerAccount = getByRole ( 'combobox' , { name : 'Partner Account' } ) ;
231+ act ( ( ) => {
232+ partnerAccount . focus ( ) ;
233+ partnerAccount . blur ( ) ;
234+ } ) ;
235+
236+ expect ( await findByText ( 'Partner Account is required' ) ) . toBeInTheDocument ( ) ;
237+ } ) ;
211238} ) ;
You can’t perform that action at this time.
0 commit comments