Skip to content

Commit

Permalink
Remove original prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
leung018 committed Jun 16, 2024
1 parent 61e0d48 commit 928944d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/app/components/quiz.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.setName('My Question Set')
.build(),
})
Expand All @@ -28,7 +28,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByText, getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
description: 'Sample Question?',
mc: presetCorrectChoiceMcBuilder()
Expand All @@ -47,7 +47,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
description: 'Question 1',
})
Expand All @@ -64,7 +64,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
mc: presetCorrectChoiceMcBuilder()
.appendNonFixedChoice('Choice 1')
Expand All @@ -91,7 +91,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
mc: presetCorrectChoiceMcBuilder()
.appendNonFixedChoice('Question 1 Choice A')
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { findByText, getByText, getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
mc: new MultipleChoiceBuilder()
.setCorrectChoiceIndex(0)
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByText, getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
mc: presetCorrectChoiceMcBuilder()
.appendNonFixedChoice('Question 1 Choice 1')
Expand All @@ -194,7 +194,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByText, getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: new QuestionSetBuilderForTest()
questionSet: new QuestionSetBuilderForTest()
.appendQuestion({
mc: new MultipleChoiceBuilder()
.setCorrectChoiceIndex(0)
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('MultipleChoiceQuiz', () => {
renderResult: { getByText },
questionSetRepo,
} = renderMultipleChoicePage({
originalQuestionSet,
questionSet: originalQuestionSet,
})

fireEvent.click(getByText('Submit'))
Expand All @@ -262,7 +262,7 @@ describe('MultipleChoiceQuiz', () => {
const {
renderResult: { getByLabelText },
} = renderMultipleChoicePage({
originalQuestionSet: questionSet.newSwappedChoicesQuestionSet(),
questionSet: questionSet.newSwappedChoicesQuestionSet(),
})

// Choices are swapped in the page
Expand All @@ -275,18 +275,18 @@ describe('MultipleChoiceQuiz', () => {
})

function renderMultipleChoicePage({
originalQuestionSet = new QuestionSetBuilderForTest().build(),
questionSet = new QuestionSetBuilderForTest().build(),
}: {
originalQuestionSet?: QuestionSet
questionSet?: QuestionSet
} = {}) {
const questionSetRepo = LocalStorageQuestionSetRepo.createNull()
questionSetRepo.upsertQuestionSet(originalQuestionSet)
questionSetRepo.upsertQuestionSet(questionSet)

return {
renderResult: render(
MultipleChoiceQuizUIService.createNull({
questionSetRepo,
questionSetId: originalQuestionSet.id,
questionSetId: questionSet.id,
}).getElement(),
),
questionSetRepo: questionSetRepo,
Expand Down

0 comments on commit 928944d

Please sign in to comment.