diff --git a/src/popup/PopupLayer.tsx b/src/popup/PopupLayer.tsx index edb78d1ec..92bb0b98e 100644 --- a/src/popup/PopupLayer.tsx +++ b/src/popup/PopupLayer.tsx @@ -89,7 +89,7 @@ const PopupLayer = (props: Props): JSX.Element | null => { return ( <> - {canCreate && canReply && reference && ( + {canCreate && canReply && reference && staged && (
{ expect(wrapper.exists(PopupReply)).toBe(false); }); - test('should render PopupReply if promoting a highlight', () => { + test('should render PopupReply if promoting a highlight and staged exists', () => { const wrapper = getWrapper({ mode: Mode.NONE, isPromoting: true }); expect(wrapper.exists(PopupReply)).toBe(true); }); + + test('should not render PopupReply if promoting a highlight but staged does not exist', () => { + const wrapper = getWrapper({ mode: Mode.NONE, isPromoting: true, staged: null }); + expect(wrapper.exists(PopupReply)).toBe(false); + }); }); describe('event handlers', () => {