Remove redundant 'Active profile' heading from identity card
This commit is contained in:
parent
cb63358afa
commit
566aa466b9
3 changed files with 4 additions and 10 deletions
|
|
@ -77,11 +77,10 @@ export function HomeScreen({ onNavigate, onCreateProfile }: HomeScreenProps) {
|
|||
</header>
|
||||
|
||||
{active && (
|
||||
<section className="card home-identity-card" aria-labelledby="active-identity-title">
|
||||
<section className="card home-identity-card">
|
||||
<div className="home-identity-content">
|
||||
<Avatar npub={active.npub} label={active.label} size="lg" picture={active.picture} />
|
||||
<div className="home-identity-copy">
|
||||
<h2 id="active-identity-title">Active profile</h2>
|
||||
<strong className="home-identity-name" aria-label="Active profile name">
|
||||
{active.label}
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -1488,10 +1488,6 @@ select {
|
|||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-identity-copy h2 {
|
||||
margin: 0 0 4px;
|
||||
}
|
||||
|
||||
.home-identity-name {
|
||||
margin: 0 0 4px;
|
||||
color: var(--text);
|
||||
|
|
|
|||
|
|
@ -23,10 +23,9 @@ describe('HomeScreen', () => {
|
|||
const { onNavigate } = renderHome(backend);
|
||||
renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />);
|
||||
|
||||
// The active profile name appears both in the identity card and in the profile row.
|
||||
const identityCard = (await screen.findByText('Active profile')).closest(
|
||||
'.home-identity-card',
|
||||
) as HTMLElement;
|
||||
// Wait for the identity card to appear after state loads.
|
||||
const switchBtn = await screen.findByRole('button', { name: 'Switch profile' });
|
||||
const identityCard = switchBtn.closest('.home-identity-card') as HTMLElement;
|
||||
expect(within(identityCard).getByText('Alice')).toBeInTheDocument();
|
||||
expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue