Skip to content

Commit b1ee713

Browse files
committed
f
1 parent f539657 commit b1ee713

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

webapp/src/RoleSheet.spec.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ describe('RoleSheet', () => {
7070
expect(earnPointsButton).toBeInTheDocument();
7171
})
7272

73+
it('hides earn button when role does not match position', () => {
74+
render(
75+
<RoleSheet
76+
role="Talking"
77+
position="Typing"
78+
player={new Player("Roger")}
79+
scorePoints={jest.fn()}
80+
/>
81+
);
82+
83+
expect(screen.queryByLabelText('Earn Points')).not.toBeInTheDocument();
84+
});
85+
7386
})
7487

7588

webapp/src/RoleSheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function RoleSheet({
5151
</div>
5252
)}
5353

54-
{!pointsScored && (
54+
{role == position && !pointsScored && (
5555
<button
5656
className="rpgui-button"
5757
aria-label={"Earn Points"}>

0 commit comments

Comments
 (0)