From 9878c2902ef7ad233bd7bfa9086b159063029654 Mon Sep 17 00:00:00 2001 From: Finn Ickler Date: Mon, 19 Feb 2024 10:47:40 +0100 Subject: [PATCH] add tests --- spec/result.spec.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/spec/result.spec.ts b/spec/result.spec.ts index ebc3a07..d099b08 100644 --- a/spec/result.spec.ts +++ b/spec/result.spec.ts @@ -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") + }) });