Skip to content

Commit

Permalink
added dummy test cases to all usages of FinishCodeCard
Browse files Browse the repository at this point in the history
  • Loading branch information
bzhang102 committed Feb 23, 2024
1 parent ba857fa commit 7b135ea
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/binary-comps/BinaryCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Blue from '../shared/Blue';
import BinaryCodeDropdown from '../shared/Dropdown';
import Gold from '../shared/Gold';
import Tab from '../shared/Tab';
import { TestCase } from '../shared/TestCase';

function BinaryCode(): JSX.Element {
const [selectedanswer, setselectedanswer] = useState<
Expand Down Expand Up @@ -112,7 +113,6 @@ function BinaryCode(): JSX.Element {
return (
<>
<FinishCodeCard
name=""
description="Your answer will be tested with the given words array at the start with the target word 'pear'."
correct_answer={[
givenBinarySearch(arr, 'pear', 0, arr.length - 1) ===
Expand All @@ -124,6 +124,12 @@ function BinaryCode(): JSX.Element {
createBinarySearch(selectedanswer)(arr, 'pear', 0, arr.length - 1)
} //built function
answer_key={answerKey} //answer key
name="finish"
testCases={[
new TestCase('1', '1'),
new TestCase('2', '2'),
new TestCase('3', '3'),
]}
>
<div className="left-align">
<span>
Expand Down
6 changes: 6 additions & 0 deletions src/components/bunny-comps/BunnyCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Blue from '../shared/Blue';
import BunnyCodeDropdown from '../shared/Dropdown';
import Gold from '../shared/Gold';
import Tab from '../shared/Tab';
import { TestCase } from '../shared/TestCase';

function BunnyCode(): JSX.Element {
const [selectedanswer, setselectedanswer] = useState({
Expand Down Expand Up @@ -142,6 +143,11 @@ function BunnyCode(): JSX.Element {
}
answer_key={answerKey}
name="bunny"
testCases={[
new TestCase('1', '1'),
new TestCase('2', '2'),
new TestCase('3', '3'),
]}
>
<div className="left-align">
<Blue>def</Blue>
Expand Down
6 changes: 6 additions & 0 deletions src/components/dining-comps/DiningCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Blue from '../shared/Blue';
import DiningDropDown from '../shared/Dropdown';
import Gold from '../shared/Gold';
import Tab from '../shared/Tab';
import { TestCase } from '../shared/TestCase';

function DiningCode(): JSX.Element {
const [selectedanswer, setselectedanswer] = useState({
Expand Down Expand Up @@ -137,6 +138,11 @@ function DiningCode(): JSX.Element {
}
answer_key={answerKey}
name="dining"
testCases={[
new TestCase('1', '1'),
new TestCase('2', '2'),
new TestCase('3', '3'),
]}
>
<div className="left-align">
<span>
Expand Down
6 changes: 6 additions & 0 deletions src/components/intro_comps/intro_code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Blue from '../shared/Blue';
import IntroDropdown from '../shared/Dropdown';
import Gold from '../shared/Gold';
import Tab from '../shared/Tab';
import { TestCase } from '../shared/TestCase';

function IntroCode(): JSX.Element {
const [selectedanswer, setselectedanswer] = useState({
Expand Down Expand Up @@ -90,6 +91,11 @@ function IntroCode(): JSX.Element {
given_function={() => factorial(5)}
answer_key={answerKey}
name="intro"
testCases={[
new TestCase('1', '1'),
new TestCase('2', '2'),
new TestCase('3', '3'),
]}
>
<div className="left-align">
<Blue>def</Blue>
Expand Down

0 comments on commit 7b135ea

Please sign in to comment.