File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ describe('Sidebar Component', () => {
5050
5151 it ( 'deve renderizar a logo da Flugo' , ( ) => {
5252 renderWithProviders ( < Sidebar /> )
53- const logo = screen . getByAltText ( 'Flugo' )
54- expect ( logo ) . toBeDefined ( )
55- expect ( logo . getAttribute ( 'src' ) ) . toContain ( 'flugo_hor.png' )
53+ const logo = screen . getAllByAltText ( 'Flugo Logo' ) [ 0 ]
54+ expect ( logo ) . toBeInTheDocument ( )
55+ expect ( logo ) . toHaveAttribute ( 'src' , expect . stringContaining ( 'flugo_hor.png' ) )
5656 } )
5757} )
Original file line number Diff line number Diff line change @@ -54,18 +54,21 @@ beforeEach(() => {
5454
5555describe ( 'useStaffForm' , ( ) => {
5656 describe ( 'estado inicial' , ( ) => {
57- it ( 'começa no passo 0' , ( ) => {
57+ it ( 'começa no passo 0' , async ( ) => {
5858 const { result } = renderHook ( ( ) => useStaffForm ( ) , { wrapper : createWrapper ( ) } )
59+ await waitFor ( ( ) => expect ( result . current . departments . length ) . toBe ( 0 ) )
5960 expect ( result . current . activeStep ) . toBe ( 0 )
6061 } )
6162
62- it ( 'retorna 2 steps' , ( ) => {
63+ it ( 'retorna 2 steps' , async ( ) => {
6364 const { result } = renderHook ( ( ) => useStaffForm ( ) , { wrapper : createWrapper ( ) } )
65+ await waitFor ( ( ) => expect ( result . current . departments . length ) . toBe ( 0 ) )
6466 expect ( result . current . steps ) . toHaveLength ( 2 )
6567 } )
6668
67- it ( 'toast começa nulo' , ( ) => {
69+ it ( 'toast começa nulo' , async ( ) => {
6870 const { result } = renderHook ( ( ) => useStaffForm ( ) , { wrapper : createWrapper ( ) } )
71+ await waitFor ( ( ) => expect ( result . current . departments . length ) . toBe ( 0 ) )
6972 expect ( result . current . toast ) . toBeNull ( )
7073 } )
7174 } )
You can’t perform that action at this time.
0 commit comments