File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,13 +107,10 @@ describe('ProfilePage', () => {
107107 it ( 'should render the profile page for a non-artist' , async ( ) => {
108108 renderProfilePage ( nonArtistUser )
109109
110- // User header
111- expect (
112- await screen . findByRole ( 'heading' , { name : nonArtistUser . name } )
113- ) . toBeInTheDocument ( )
110+ // User header (name may have trailing space in mobile header)
114111 expect (
115112 await screen . findByRole ( 'heading' , {
116- name : `@ ${ nonArtistUser . handle } `
113+ name : new RegExp ( `^ ${ nonArtistUser . name } \\s*$` )
117114 } )
118115 ) . toBeInTheDocument ( )
119116
@@ -237,9 +234,11 @@ describe('ProfilePage', () => {
237234 }
238235 )
239236
240- // Wait for the profile to load
237+ // Wait for the profile to load (name may have trailing space in mobile header)
241238 expect (
242- await screen . findByRole ( 'heading' , { name : artistUser . name } )
239+ await screen . findByRole ( 'heading' , {
240+ name : new RegExp ( `^${ artistUser . name } \\s*$` )
241+ } )
243242 ) . toBeInTheDocument ( )
244243
245244 // Verify that coin-related elements are present when user has coins
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ type TestUser = typeof artistUser | typeof nonArtistUser
3131 */
3232export const mockUserByHandle = ( user : typeof artistUser ) =>
3333 http . get ( `${ apiEndpoint } /v1/users/handle/${ user . handle } ` , ( ) =>
34- HttpResponse . json ( { data : [ user ] } )
34+ HttpResponse . json ( { data : user } )
3535 )
3636
3737export const mockRelatedUsers = (
You can’t perform that action at this time.
0 commit comments