- Replace avatar image from API with gradient avatar from twake-mui (#457)

- Display 2-letter initials (e.g., "JD" for "John Doe") instead of single letter
- Add getInitials helper function in avatarUtils for reusability
- Update Avatar in PeopleSearch, CalendarSearch, and Menubar components
- Remove avatarUrl prop usage across all Avatar components
This commit is contained in:
lenhanphung
2026-01-13 20:44:42 +07:00
committed by GitHub
parent 00266d2701
commit 8b3afc1737
9 changed files with 206 additions and 33 deletions
@@ -2032,6 +2032,25 @@ describe("Helper functions", () => {
expect(typeof result.color).toBe("string");
});
it("stringAvatar returns 2-letter initials for full name", () => {
const result = stringAvatar("John Doe");
expect(result.children).toBe("JD");
expect(result.color).toBeDefined();
expect(typeof result.color).toBe("string");
});
it("stringAvatar handles single word names", () => {
const result = stringAvatar("Alice");
expect(result.children).toBe("A");
expect(result.color).toBeDefined();
});
it("stringAvatar handles email addresses", () => {
const result = stringAvatar("test@example.com");
expect(result.children).toBe("T");
expect(result.color).toBeDefined();
});
it("InfoRow renders text and link if url is valid", () => {
renderWithProviders(
<InfoRow