Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/popup/PopupLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const PopupLayer = (props: Props): JSX.Element | null => {

return (
<>
{canCreate && canReply && reference && (
{canCreate && canReply && reference && staged && (
<div className="ba-PopupLayer-popup">
<PopupReply
isPending={isPending}
Expand Down
7 changes: 6 additions & 1 deletion src/popup/__tests__/PopupLayer-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,15 @@ describe('PopupLayer', () => {
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', () => {
Expand Down