Skip to content

Commit f23428c

Browse files
authored
Merge pull request #25 from ironhack-labs/uros/feat/tests-shuffle-choices
Update tests and add more elements to choices array
2 parents 12bf813 + 6d9c975 commit f23428c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/question.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ describe("Question", () => {
8080

8181
it("should shuffle the items in the 'choices' array", () => {
8282
// Array with the question choices to be used in the test and passed to the Quiz constructor
83-
const testChoices = ["choice1", "choice2", "choice3"];
83+
const testChoices = ["choice1", "choice2", "choice3", "choice4", "choice5"];
8484

8585
// Instantiate a new Question object with the test choices array
8686
const question = new Question("test", testChoices, "test");
8787
// Call the shuffleChoices() method on the Question object
8888
question.shuffleChoices();
8989

9090
// Check that the 'choices' property of the Question object is not equal to the test choices array (i.e. it has been changed/shuffled)
91-
expect(question.choices).not.toEqual(["choice1", "choice2", "choice3"]);
92-
expect(question.choices.length).toEqual(3);
91+
expect(question.choices).not.toEqual(["choice1", "choice2", "choice3", "choice4", "choice5"]);
92+
expect(question.choices.length).toEqual(5);
9393
});
9494
});
95-
});
95+
});

0 commit comments

Comments
 (0)