feat(profile)!: replace sidebar and add avatar navigation
Rename the global Sidebar route, UI, assets, analytics, and payment return context to Profile. Add accessible message-avatar navigation and preserve the source character across auth and logout flows. BREAKING CHANGE: /sidebar has been removed; use /profile instead.
This commit is contained in:
@@ -79,4 +79,34 @@ describe("shared Tailwind components", () => {
|
||||
expect(guestHtml).toContain('aria-label="Guest avatar"');
|
||||
expect(guestHtml).toContain("%2Fimages%2Favatar%2Fplaceholder.png");
|
||||
});
|
||||
|
||||
it("renders interactive avatars as accessible buttons", () => {
|
||||
const characterHtml = renderToStaticMarkup(
|
||||
<CharacterAvatar
|
||||
src="/images/avatar/elio.png"
|
||||
alt="Elio Silvestri"
|
||||
actionLabel="Open Elio's private room"
|
||||
analyticsKey="chat.open_private_room_from_avatar"
|
||||
onClick={() => undefined}
|
||||
/>,
|
||||
);
|
||||
const userHtml = renderToStaticMarkup(
|
||||
<UserMessageAvatar
|
||||
actionLabel="Open profile"
|
||||
analyticsKey="chat.open_profile_from_avatar"
|
||||
onClick={() => undefined}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(characterHtml).toContain('<button type="button"');
|
||||
expect(characterHtml).toContain(
|
||||
'aria-label="Open Elio's private room"',
|
||||
);
|
||||
expect(characterHtml).toContain(
|
||||
'data-analytics-key="chat.open_private_room_from_avatar"',
|
||||
);
|
||||
expect(userHtml).toContain('<button type="button"');
|
||||
expect(userHtml).toContain('aria-label="Open profile"');
|
||||
expect(userHtml).toContain("focus-visible:outline-3");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user