File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ describe('RoleSheet', () => {
2525 roles [ "Observing" ] . todos . forEach ( todo => expect ( screen . getByText ( todo ) ) . toBeInTheDocument ( ) )
2626 } ) ;
2727
28+
29+ it ( `shows Other Roles todos when in Observing position` , ( ) => {
30+ const roger = new Player ( "Roger" ) ;
31+ roger . scoreTimes ( "Typing" , 3 ) ;
32+ roger . selectRole ( "Sponsor" ) ;
33+ render ( < RoleSheet role = "Sponsor" position = "Observing" player = { roger } scorePoints = { ( ) => { } } /> ) ;
34+
35+ roles [ "Sponsor" ] . todos . forEach ( todo => expect ( screen . getByText ( todo ) ) . toBeInTheDocument ( ) )
36+ } ) ;
37+
2838 it ( `scores a single point using the checkboxes when submitting` , async ( ) => {
2939 const mockScorePoints = jest . fn ( ) ;
3040 render ( < RoleSheet role = "Typing" position = "Typing" player = { new Player ( "Roger" ) } scorePoints = { mockScorePoints } /> ) ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export function RoleSheet({
3030 }
3131 }
3232
33+ const canEarnPoints = role === position || position === "Observing" && role !== "Talking" && role != "Typing" ;
3334 return < div className = "role" >
3435 < hr />
3536 < label className = "role-label" >
@@ -45,7 +46,7 @@ export function RoleSheet({
4546 < EarnPointsForRole role = { role } scorePoints = { scorePoints } />
4647
4748 < form onSubmit = { onSubmitCheckboxes } >
48- { role === position && (
49+ { canEarnPoints && (
4950 < >
5051 { roles [ role ] ?. todos ?. map ( ( todo , index ) => (
5152 < TodoItem
You can’t perform that action at this time.
0 commit comments