diff --git a/ui/src/journal/header.tsx b/ui/src/journal/header.tsx index 73cf137..9432bf9 100644 --- a/ui/src/journal/header.tsx +++ b/ui/src/journal/header.tsx @@ -32,9 +32,9 @@ function Header(props: Props) { const setEditing = useCallback(() => { props.setEditing({ - journal: state.journals[0].name, + journal: selectedJournal, }); - }, [state.journals]); + }, [state.journals, selectedJournal]); if (!state.journals.length) { // really, should be handled above. But this provides some protection diff --git a/ui/src/journal/journal.test.tsx b/ui/src/journal/journal.test.tsx new file mode 100644 index 0000000..cc85721 --- /dev/null +++ b/ui/src/journal/journal.test.tsx @@ -0,0 +1,8 @@ +import { suite, test } from "mocha"; + +suite("header", function () { + test("current journal can be selected from the dropdown"); + test( + "add button creates a document for today in the currently selected journal" + ); +});