Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Feb 19, 2024
1 parent 393af0e commit 9878c29
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/result.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,26 @@ describe('Result helper', function () {
expect(decodeMultiResult(979999902)).toEqual({ solved: 4, attempted: 6 });
});

it('Correctly Formats Attempt Results ')
it('Correctly Formats FMC Result', function (){
expect(attemptResultToString({ attemptResult: 24, eventId: '333fm' })).toEqual('24 moves')
})

it('Correctly Formats MBLD Result', function (){
expect(attemptResultToString({ attemptResult: encodeMultiResult({
solved: 6,
attempted: 6,
}), eventId: '333mbf' })).toEqual('6 points')
})

it('Correctly Formats 333 Result in Seconds', function (){
expect(attemptResultToString({attemptResult: 3000, eventId: "333"})).toEqual("30 seconds")
})

it('Correctly Formats 333 Result in Minutes', function (){
expect(attemptResultToString({attemptResult: 9000, eventId: "333"})).toEqual("1 minute 30 seconds")
})

it('Correctly Formats 333 Result in hours', function (){
expect(attemptResultToString({attemptResult: 360000, eventId: "333"})).toEqual("1 hour")
})
});

0 comments on commit 9878c29

Please sign in to comment.