Skip to content

Commit 9c8db32

Browse files
committed
fix module 1 tests so tasks 8 and 9 don't pass prematurely, and remove console.logs()
1 parent 2c5c8ba commit 9c8db32

6 files changed

Lines changed: 1 addition & 8 deletions

‎src/__tests__/module1/quiz-component-displays-instruction-text.test.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('Quiz Component', () => {
2929

3030
if (quiz.find('.QuizQuestion').length > 0) {
3131
assert(quiz.find('.QuizQuestion').text() == quizData.quiz_questions[0].instruction_text, "The div with a className of `QuizQuestion` isn't displaying the correct instruction text.")
32-
} else if (quiz.find('QuizQuestion')) {
3332
} else {
3433
assert(false, "There is not a div with a className of QuizQuestion yet.")
3534
}

‎src/__tests__/module1/quiz-component-has-quiz-question-div.test.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ describe('Quiz Component', () => {
3737
assert(el.props.children == quizData.quiz_questions[0].instruction_text)
3838
}
3939
}
40-
} else if (quiz.find('QuizQuestion')) {
4140
} else if (quiz.containsMatchingElement(<div>Quiz</div>)) {
4241
// this block will run until @quiz-component-has-quiz-question-div
4342
assert(false, "The Quiz component isn't rendering a single div with the class `QuizQuestion`.")

‎src/__tests__/module1/quiz-component-has-render-method.test.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ describe('Quiz Component', () => {
2929

3030
if (quiz.containsMatchingElement(<div className="QuizQuestion"></div>)) {
3131
// this block will run after @quiz-component-has-quiz-question-div
32-
} else if ( quiz.find('.QuizQuestion').getElements().length == 1) {
32+
} else if (quiz.find('.QuizQuestion').getElements().length == 1) {
3333
let el = quiz.find('.QuizQuestion').getElements()[0];
3434
if (el.props.className == 'QuizQuestion') {
3535
if (el.props.children == null) {
3636
assert(el.props.children == quizData.quiz_questions[0].instruction_text)
3737
}
3838
}
39-
} else if (quiz.find('QuizQuestion')) {
40-
// this block will run after @quiz-component-displays-quiz-question-component
4139
} else {
4240
// this block will run until @quiz-component-has-quiz-question-div
4341
assert(quiz.containsMatchingElement(<div>Quiz</div>), "The Quiz component isn't rendering a single div with the text `Quiz`.")

‎src/__tests__/module2/quiz-question-component-has-render-method.test.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ describe('QuizQuestion Component', () => {
3737
assert(div.querySelector('main') != null, "We can't find a `main` tag in the QuizQuestion component's JSX.")
3838
assert(div.querySelectorAll('main section') != null, "We can't find a `main` tag with a child of `section` in the QuizQuestion component's JSX.")
3939
assert(div.querySelectorAll('main section').length == 2, "We're finding some `section` tags that are children of a `main` tag, but we'd like there to be exactly *2* `section` tags - if you're having trouble, just copy the HTML that we've provided in the task instructions.")
40-
// console.log(div.querySelector('main section'))
4140
assert(div.querySelectorAll('main section')[0].querySelector('p'), "We can't find a `section` tag with a child of `p` in the QuizQuestion component's JSX.")
4241
assert(div.querySelectorAll('main section')[1].querySelector('ul'), "We can't find a `ul` tag with a child of `li` in the QuizQuestion component's JSX.")
4342
})

‎src/__tests__/module5/quiz-question-handle-click-method-returns-correct-value.test.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ describe('QuizQuestion Component', () => {
4242
try {
4343
quiz = shallow(<Quiz />)
4444
} catch (e) {
45-
console.log(e)
4645
assert(false, "We weren't able to mount the Quiz component.")
4746
}
4847

‎src/__tests__/module7/quiz-end-handle-click-method-returns-correct-value.test.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('QuizEnd Component', () => {
3232
try {
3333
quiz = shallow(<Quiz />)
3434
} catch (e) {
35-
console.log(e)
3635
assert(false, "We weren't able to mount the Quiz component.")
3736
}
3837

0 commit comments

Comments
 (0)