test+fix(docs): correct fallbackLabel when sort prop is omitted
Add failing test for DATE-sort + undated doc showing "Undatiert" fallback label, then fix DocumentList by null-coalescing sort before comparison ((sort ?? 'DATE') === 'DATE'). Test uses one dated + one undated doc to produce two groups and trigger GroupDivider rendering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,9 @@ let {
|
||||
sort?: string;
|
||||
} = $props();
|
||||
|
||||
const fallbackLabel = $derived(sort === 'DATE' ? m.docs_group_undated() : m.docs_group_unknown());
|
||||
const fallbackLabel = $derived(
|
||||
(sort ?? 'DATE') === 'DATE' ? m.docs_group_undated() : m.docs_group_unknown()
|
||||
);
|
||||
const groupedDocuments = $derived.by(() =>
|
||||
groupDocuments(documents, sort ?? 'DATE', fallbackLabel)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user