Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 9d0e527

Browse files
authored
Merge pull request #50 from githubtraining/validations
added validations to every step
2 parents cb8f2a9 + 5745f1d commit 9d0e527

File tree

7 files changed

+71
-1
lines changed

7 files changed

+71
-1
lines changed

config.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ steps:
5353
- type: getPullRequest
5454
pullRequest: Changes
5555
action_id: metaPR2
56+
- type: getFileContents
57+
action_id: fileContents
58+
filename: 'src/App.jsx'
59+
- type: gate
60+
left: '/^\s*<\s*h3\s*className\s*=\s*"\s*Box-title\s*d-flex\s*flex-justify-center\s*"\s*>\s*GradeBook\s*<\s*\/\s*h3\s*>/gm'
61+
operator: test
62+
right: '%actions.fileContents%'
63+
else:
64+
- type: respond
65+
with: bad-header.md
66+
issue: Changes
5667
- type: respond
5768
with: 02-props.md
5869
issue: Changes
@@ -74,6 +85,17 @@ steps:
7485
- type: getPullRequest
7586
pullRequest: Changes
7687
action_id: metaPR2
88+
- type: getFileContents
89+
action_id: fileContents
90+
filename: 'src/App.jsx'
91+
- type: gate
92+
left: '/^\s*import\s*List\s*from\s*"\s*\.\/List\s*"\s*;\s*/gm'
93+
operator: test
94+
right: '%actions.fileContents%'
95+
else:
96+
- type: respond
97+
with: bad-import.md
98+
issue: Changes
7799
- type: createPullRequestComment
78100
body: uncomment-assignments-activity.md
79101
file: src/App.jsx
@@ -121,6 +143,17 @@ steps:
121143
- type: getPullRequest
122144
pullRequest: Changes
123145
action_id: metaPR2
146+
- type: getFileContents
147+
action_id: fileContents
148+
filename: 'src/List.jsx'
149+
- type: gate
150+
left: '/>\s*{\s*this\.props\.title\s*}\s*<\s*/gm'
151+
operator: test
152+
right: '%actions.fileContents%'
153+
else:
154+
- type: respond
155+
with: bad-prop.md
156+
issue: Changes
124157
- type: respond
125158
with: 03-state.md
126159
issue: Changes
@@ -142,6 +175,17 @@ steps:
142175
- type: getPullRequest
143176
pullRequest: Changes
144177
action_id: metaPR2
178+
- type: getFileContents
179+
action_id: fileContents
180+
filename: 'src/App.jsx'
181+
- type: gate
182+
left: '/\s*students\s*:\s*\[\s*\]\s*,\s*/gm'
183+
operator: test
184+
right: '%actions.fileContents%'
185+
else:
186+
- type: respond
187+
with: bad-state.md
188+
issue: Changes
145189
- type: createPullRequestComment
146190
body: explaining-this-state-activity.md
147191
file: src/App.jsx
@@ -231,6 +275,17 @@ steps:
231275
- type: getPullRequest
232276
pullRequest: Changes
233277
action_id: metaPR2
278+
- type: getFileContents
279+
action_id: fileContents
280+
filename: 'src/App.jsx'
281+
- type: gate
282+
left: '/\s*placeholder\s*=\s*"Add\sStudent\.\.\."\s*\n\s*currList\s*=\s*{\s*this\.state\.students\s*}\n\s*addFunction\s*=\s*{\s*this\.addStudent\s*}\s*\n/gm'
283+
operator: test
284+
right: '%actions.fileContents%'
285+
else:
286+
- type: respond
287+
with: bad-replace.md
288+
issue: Changes
234289
- type: createPullRequestComment
235290
body: uncomment-grades-activity.md
236291
file: src/App.jsx

responses/bad-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Looks you did not create an `addStudent` function with the parameter: `studentName`.
1+
Looks like you did not create an `addStudent` function with the parameter: `studentName`.
22

33
Try again!

responses/bad-header.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Looks like you did not correctly add an `h3` component in the right place in `src/App.jsx`.
2+
3+
Try again!

responses/bad-import.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Looks like you did not import the `List` component into `App`.
2+
3+
Try again!

responses/bad-prop.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Looks like you did not replace the title with a prop in the correct place in `src/List.jsx`
2+
3+
Try again!

responses/bad-replace.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Looks like you did not replace the props for student rendering.
2+
3+
Try again!

responses/bad-state.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Looks like you did not add a `students` state variable.
2+
3+
Try again!

0 commit comments

Comments
 (0)