test(frontend): task dialog, sharing avatars, trash, API key scopes, passwords (FLAW-19)
Covers opening and closing the task dialog (the former hook-order bug), date/time fields and the view-only mode for viewer lists, the avatar stack of shared items, the two-tap delete in the trash, scope selection and badges of API keys, and the shared password rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c50d15915
commit
0fdf46635b
5 files changed
+174
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { render } from '@testing-library/react';
|
||||
import { AvatarStack } from '../AvatarStack';
|
||||
|
||||
const people = ['Anna', 'Ben', 'Carla', 'Dana', 'Emil'].map((name, i) => ({ id: `u${i}`, name }));
|
||||
|
||||
describe('AvatarStack (who a list or note is shared with)', () => {
|
||||
it('shows at most three people and the rest as +n', () => {
|
||||
const { container } = render(<AvatarStack people={people} />);
|
||||
expect(container.textContent).toContain('+2');
|
||||
expect(container.firstElementChild?.children.length).toBe(4); // 3 avatars + overflow circle
|
||||
});
|
||||
|
||||
it('renders nothing for an unshared item', () => {
|
||||
expect(render(<AvatarStack people={[]} />).container.firstChild).toBeNull();
|
||||
});
|
||||
|
||||
it('needs no overflow circle when everyone fits', () => {
|
||||
const { container } = render(<AvatarStack people={people.slice(0, 2)} />);
|
||||
expect(container.textContent).not.toContain('+');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user