@@ -57,6 +57,10 @@ jest.mock('react-i18next', () => ({
5757 return `Round ${ options ?. roundNumber } ` ;
5858 }
5959
60+ if ( key === 'common.activityCodeToName.group' ) {
61+ return `Group ${ options ?. groupNumber } ` ;
62+ }
63+
6064 return key ;
6165 } ,
6266 } ) ,
@@ -89,7 +93,15 @@ const linkedRoundsCompetition = {
8993 cutoff : null ,
9094 timeLimit : null ,
9195 advancementCondition : null ,
92- results : [ ] ,
96+ results : [
97+ {
98+ personId : 1 ,
99+ ranking : 1 ,
100+ attempts : [ ] ,
101+ best : 1000 ,
102+ average : 1200 ,
103+ } ,
104+ ] ,
93105 } ,
94106 {
95107 id : '333-r3' ,
@@ -195,9 +207,29 @@ describe('CompetitionRoundContainer', () => {
195207 it ( 'links to results for the selected round' , ( ) => {
196208 renderRound ( '333-r2' ) ;
197209
198- expect ( screen . getByText ( 'See Results' ) ) . toHaveAttribute (
199- 'href' ,
200- '/competitions/TestComp2026/results/333-r2' ,
210+ const resultsLink = screen . getByText ( 'See Results' ) ;
211+
212+ expect ( resultsLink ) . toHaveAttribute ( 'href' , '/competitions/TestComp2026/results/333-r2' ) ;
213+ expect ( screen . getByText ( 'Group 1' ) . compareDocumentPosition ( resultsLink ) ) . toBe (
214+ Node . DOCUMENT_POSITION_FOLLOWING ,
201215 ) ;
202216 } ) ;
217+
218+ it ( 'uses shared button spacing for the back link' , ( ) => {
219+ renderRound ( '333-r2' ) ;
220+
221+ expect ( screen . getByText ( 'Back To Events' ) ) . toHaveClass ( 'btn' , 'btn-block' ) ;
222+ } ) ;
223+
224+ it ( 'shows when the selected round has results' , ( ) => {
225+ renderRound ( '333-r2' ) ;
226+
227+ expect ( screen . getByText ( 'See Results' ) ) . toHaveClass ( 'btn-green' ) ;
228+ } ) ;
229+
230+ it ( 'shows a neutral results link when the selected round has no results yet' , ( ) => {
231+ renderRound ( '333-r3' ) ;
232+
233+ expect ( screen . getByText ( 'See Results' ) ) . toHaveClass ( 'btn-light' ) ;
234+ } ) ;
203235} ) ;
0 commit comments