feat(#221): add color dot to tag chips in DocumentList
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -342,6 +342,26 @@ describe('DocumentList – match snippets and highlights', () => {
|
||||
await expect.element(receiverMark).toHaveTextContent('Anna Schmidt');
|
||||
});
|
||||
|
||||
it('renders a color dot on tag chips that have a color', async () => {
|
||||
const doc = makeDoc({
|
||||
id: 'doc1',
|
||||
tags: [{ id: 'tag-1', name: 'Familie', color: 'sage' }]
|
||||
});
|
||||
render(DocumentList, { ...baseProps, documents: [doc], total: 1 });
|
||||
const dot = page.getByTestId('tag-color-dot');
|
||||
await expect.element(dot).toBeInTheDocument();
|
||||
await expect.element(dot).toHaveAttribute('data-color', 'sage');
|
||||
});
|
||||
|
||||
it('does not render a color dot on tag chips without a color', async () => {
|
||||
const doc = makeDoc({
|
||||
id: 'doc1',
|
||||
tags: [{ id: 'tag-1', name: 'Familie' }]
|
||||
});
|
||||
render(DocumentList, { ...baseProps, documents: [doc], total: 1 });
|
||||
await expect.element(page.getByTestId('tag-color-dot')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('visually marks matched tag when its id is in matchedTagIds', async () => {
|
||||
const doc = makeDoc({
|
||||
id: 'doc1',
|
||||
|
||||
Reference in New Issue
Block a user