Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83c9847

Browse files
committed
fix(site): fix OrgsSortedAlphabetically test
1 parenta272843 commit83c9847

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

‎site/src/modules/management/OrganizationSidebarView.stories.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,13 @@ export const OrgsSortedAlphabetically: Story = {
256256
// filter out Create btn
257257
constfilteredElems=orgElements.slice(0,3);
258258

259-
constorgNames=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+
constorgNames=filteredElems.map((el)=>{
263+
constnameSpan=el.querySelector(".truncate");
264+
returnnameSpan?.textContent?.trim()||"";
265+
});
263266

264267
// active name first
265268
expect(orgNames).toEqual(["Omega org","alpha Org","Zeta Org"]);

‎site/src/testHelpers/entities.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const MockOrganization: TypesGen.Organization = {
1717
name:"my-organization",
1818
display_name:"My Organization",
1919
description:"An organization that gets used for stuff.",
20-
icon:"/emojis/1f957.png",
20+
icon:"/emojis/1f60e.png",
2121
created_at:"",
2222
updated_at:"",
2323
is_default:false,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp