@@ -256,23 +256,23 @@ describe("getFlattenRecords", () => {
256256 } ) ;
257257} ) ;
258258
259- describe ( "getSumTimeRecords " , ( ) => {
259+ describe ( "getSplitRecordsSum " , ( ) => {
260260 test ( "ignores tracks that does not have a final time" , ( ) => {
261261 const { createAttempt, createSplit } = useBuildAttempt ( 2 ) ;
262262
263- const { getSumTimeRecords } = createRoot ( ( ) =>
263+ const { getSplitRecordsSum } = createRoot ( ( ) =>
264264 useAttempts ( { version : 1 , attempts : [ createAttempt ( { splits : createSplit ( "1:10.000" ) } ) ] } ) ,
265265 ) ;
266266
267- const sumTimeRecords = getSumTimeRecords ( ) ;
267+ const sumTimeRecords = getSplitRecordsSum ( ) ;
268268 expect ( sumTimeRecords . time ) . toBe ( "00:00.000" ) ;
269269 expect ( sumTimeRecords . trackCount ) . toBe ( 0 ) ;
270270 } ) ;
271271
272272 test ( "takes only one time by track" , ( ) => {
273273 const { createAttempt, createSplit } = useBuildAttempt ( 1 ) ;
274274
275- const { getSumTimeRecords } = createRoot ( ( ) =>
275+ const { getSplitRecordsSum } = createRoot ( ( ) =>
276276 useAttempts ( {
277277 version : 1 ,
278278 attempts : [
@@ -282,7 +282,39 @@ describe("getSumTimeRecords", () => {
282282 } ) ,
283283 ) ;
284284
285- const sumTimeRecords = getSumTimeRecords ( ) ;
285+ const sumTimeRecords = getSplitRecordsSum ( ) ;
286+ expect ( sumTimeRecords . time ) . toBe ( "01:10.000" ) ;
287+ expect ( sumTimeRecords . trackCount ) . toBe ( 1 ) ;
288+ } ) ;
289+ } ) ;
290+
291+ describe ( "getTimeRecordsSum" , ( ) => {
292+ test ( "ignores tracks that does not have a final time" , ( ) => {
293+ const { createAttempt, createSplit } = useBuildAttempt ( 2 ) ;
294+
295+ const { getTimeRecordsSum } = createRoot ( ( ) =>
296+ useAttempts ( { version : 1 , attempts : [ createAttempt ( { splits : createSplit ( "1:10.000" ) } ) ] } ) ,
297+ ) ;
298+
299+ const sumTimeRecords = getTimeRecordsSum ( ) ;
300+ expect ( sumTimeRecords . time ) . toBe ( "00:00.000" ) ;
301+ expect ( sumTimeRecords . trackCount ) . toBe ( 0 ) ;
302+ } ) ;
303+
304+ test ( "takes only one time by track" , ( ) => {
305+ const { createAttempt, createSplit } = useBuildAttempt ( 1 ) ;
306+
307+ const { getTimeRecordsSum } = createRoot ( ( ) =>
308+ useAttempts ( {
309+ version : 1 ,
310+ attempts : [
311+ createAttempt ( { splits : createSplit ( "1:10.000" ) } ) ,
312+ createAttempt ( { splits : createSplit ( "1:10.000" ) } ) ,
313+ ] ,
314+ } ) ,
315+ ) ;
316+
317+ const sumTimeRecords = getTimeRecordsSum ( ) ;
286318 expect ( sumTimeRecords . time ) . toBe ( "01:10.000" ) ;
287319 expect ( sumTimeRecords . trackCount ) . toBe ( 1 ) ;
288320 } ) ;
0 commit comments