diff --git a/client/src/features/book/components/__tests__/DetailsTab.spec.ts b/client/src/features/book/components/__tests__/DetailsTab.spec.ts index edce4d391..5071f609c 100644 --- a/client/src/features/book/components/__tests__/DetailsTab.spec.ts +++ b/client/src/features/book/components/__tests__/DetailsTab.spec.ts @@ -281,6 +281,20 @@ describe('DetailsTab - present state', () => { expect(wrapper.emitted('saved')?.[0]).toEqual([updated]) }) + it('opens the personal review editor from the review summary', async () => { + const wrapper = mount(DetailsTab, { + props: { book: makeBook() }, + global: globalStubs, + }) + await flushPromises() + + const writeButton = wrapper.findAll('button').find((button) => button.text() === 'Write') + expect(writeButton).toBeTruthy() + await writeButton!.trigger('click') + + expect(wrapper.find('textarea').isVisible()).toBe(true) + }) + it('shows reading date fields when both dates are null and status is null', () => { const wrapper = mount(DetailsTab, { props: { book: makeBook({ status: 'present', readStatus: null }) }, diff --git a/client/src/features/book/components/detail/tabs/DetailsTab.vue b/client/src/features/book/components/detail/tabs/DetailsTab.vue index f76389081..9f0a4cf87 100644 --- a/client/src/features/book/components/detail/tabs/DetailsTab.vue +++ b/client/src/features/book/components/detail/tabs/DetailsTab.vue @@ -435,6 +435,11 @@ const { const personalNoteUpdatedLabel = computed(() => (props.book.personalNoteUpdatedAt ? formatDateTime(props.book.personalNoteUpdatedAt) : null)) +function startVisiblePersonalNoteEdit() { + showPersonalReview.value = true + startPersonalNoteEdit() +} + watch( () => props.book.id, () => { @@ -1852,7 +1857,7 @@ watch(