diff --git a/exercises/practice/high-scores/.meta/config.json b/exercises/practice/high-scores/.meta/config.json index a3ad5bcca9..c328c18b91 100644 --- a/exercises/practice/high-scores/.meta/config.json +++ b/exercises/practice/high-scores/.meta/config.json @@ -7,6 +7,7 @@ "cmccandless", "ffflorian", "hayashi-ay", + "jagdish-15", "SleeplessByte" ], "files": { diff --git a/exercises/practice/high-scores/.meta/tests.toml b/exercises/practice/high-scores/.meta/tests.toml index 4008e01258..7c94633801 100644 --- a/exercises/practice/high-scores/.meta/tests.toml +++ b/exercises/practice/high-scores/.meta/tests.toml @@ -1,6 +1,13 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [1035eb93-2208-4c22-bab8-fef06769a73c] description = "List of scores" @@ -12,16 +19,28 @@ description = "Latest score" description = "Personal best" [3d996a97-c81c-4642-9afc-80b80dc14015] -description = "Personal top three from a list of scores" +description = "Top 3 scores -> Personal top three from a list of scores" [1084ecb5-3eb4-46fe-a816-e40331a4e83a] -description = "Personal top highest to lowest" +description = "Top 3 scores -> Personal top highest to lowest" [e6465b6b-5a11-4936-bfe3-35241c4f4f16] -description = "Personal top when there is a tie" +description = "Top 3 scores -> Personal top when there is a tie" [f73b02af-c8fd-41c9-91b9-c86eaa86bce2] -description = "Personal top when there are less than 3" +description = "Top 3 scores -> Personal top when there are less than 3" [16608eae-f60f-4a88-800e-aabce5df2865] -description = "Personal top when there is only one" +description = "Top 3 scores -> Personal top when there is only one" + +[2df075f9-fec9-4756-8f40-98c52a11504f] +description = "Top 3 scores -> Latest score after personal top scores" + +[809c4058-7eb1-4206-b01e-79238b9b71bc] +description = "Top 3 scores -> Scores after personal top scores" + +[ddb0efc0-9a86-4f82-bc30-21ae0bdc6418] +description = "Top 3 scores -> Latest score after personal best" + +[6a0fd2d1-4cc4-46b9-a5bb-2fb667ca2364] +description = "Top 3 scores -> Scores after personal best" diff --git a/exercises/practice/high-scores/high-scores.spec.js b/exercises/practice/high-scores/high-scores.spec.js index 67280f60f6..682a8e9778 100644 --- a/exercises/practice/high-scores/high-scores.spec.js +++ b/exercises/practice/high-scores/high-scores.spec.js @@ -42,5 +42,33 @@ describe('High Scores Test Suite', () => { const input = [40]; expect(new HighScores(input).personalTopThree).toEqual([40]); }); + + xtest('Latest score after personal top scores', () => { + const input = [70, 50, 20, 30]; + const highScores = new HighScores(input); + highScores.personalTopThree; + expect(highScores.latest).toEqual(30); + }); + + xtest('Scores after personal top scores', () => { + const input = [30, 50, 20, 70]; + const highScores = new HighScores(input); + highScores.personalTopThree; + expect(highScores.scores).toEqual(input); + }); + + xtest('Latest score after personal best', () => { + const input = [20, 70, 15, 25, 30]; + const highScores = new HighScores(input); + highScores.personalBest; + expect(highScores.latest).toEqual(30); + }); + + xtest('Scores after personal best', () => { + const input = [20, 70, 15, 25, 30]; + const highScores = new HighScores(input); + highScores.personalBest; + expect(highScores.scores).toEqual(input); + }); }); });