File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
site/src/modules/management Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -256,10 +256,13 @@ export const OrgsSortedAlphabetically: Story = {
256256 // filter out Create btn
257257 const filteredElems = orgElements . slice ( 0 , 3 ) ;
258258
259- const orgNames = filteredElems . map (
260- // handling fuzzy matching
261- ( el ) => el . textContent ?. replace ( / ^ [ A - Z ] / , "" ) . trim ( ) || "" ,
262- ) ;
259+ // Query the .truncate span to get only the organization name.
260+ // This avoids including the avatar content, which renders as the first
261+ // uppercase letter of the org name when the icon fails to load.
262+ const orgNames = filteredElems . map ( ( el ) => {
263+ const nameSpan = el . querySelector ( ".truncate" ) ;
264+ return nameSpan ?. textContent ?. trim ( ) || "" ;
265+ } ) ;
263266
264267 // active name first
265268 expect ( orgNames ) . toEqual ( [ "Omega org" , "alpha Org" , "Zeta Org" ] ) ;
You can’t perform that action at this time.
0 commit comments