Skip to content

Commit c3f22c9

Browse files
committed
Finish fourth mini-quiz, + add some humour
1 parent d07bed7 commit c3f22c9

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

pages/lessons/projects/4.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ into a new `describe` section.
437437

438438
Where exactly do we add this `describe` block?
439439

440+
{/* I think we could do this more cleanly with the following // commented line and its explanation */}
440441
Currently the end of our `tier-nft.test.js` looks like this, with just one
441442
additional comment line I added that says
442443
`// this is where existing describe section ends`:
@@ -460,6 +461,7 @@ additional comment line I added that says
460461
Our new `describe` section shown below will replace that line that says
461462
`// this is where existing describe section ends`.
462463

464+
{/* The sentence in the callout below is a bit messy. Could do with an update */}
463465
<Callout emoji="💡" size="md" variant="info">
464466
Make sure you keep that last line `})` which is the very end of the block of
465467
code that holds **all** of the `describe` blocks you're adding in this whole
@@ -605,7 +607,7 @@ of additional highlights:
605607
breaks our rule of one expect per test, but as long as the test is kept
606608
simple, we can choose what makes sense for what we're trying to test.
607609

608-
<SideDrawer buttonText="Checkpoint Questions" title="Mint and Withdraw">
610+
<SideDrawer buttonText="Checkpoint Questions" title="Cross-checking Logic from Tests to Contract">
609611
<Question question="lesson-4/4-mint-withdraw/Q1" />
610612
<Question question="lesson-4/4-mint-withdraw/Q2" />
611613
<Question question="lesson-4/4-mint-withdraw/Q3" />

utils/questions/lesson-4/4-mint-withdraw/Q1.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
"question": "Syntax errors: is your final '})' syntax matching the opening 'describe('TierNFT', function () {' every time you add new tests?",
33
"options": [
44
{
5-
"answer": "Yes",
6-
"correct": true
5+
"answer": "Yes"
76
},
87
{
9-
"answer": "No? It's easy to run into errors with the smallest things. We all do it. Take your time to read the error messages."
8+
"answer": "No? It's easy to run into syntax errors with the smallest things. We all do it. Take your time to read the error messages."
9+
},
10+
{
11+
"answer": "There is no right or wrong option with this question.....it's just a gentle reminder :-)"
1012
}
1113
]
1214
}

utils/questions/lesson-4/4-mint-withdraw/Q4.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"question": "In the 'withdraw()' tests, why is the line 'await contract.connect(otherUser).withdraw()' used?",
33
"options": [
44
{
5-
"answer": "To ensure the contract owner can withdraw the entire contract balance."
5+
"answer": "To ensure the 'otherUser' can withdraw the entire contract balance."
66
},
77
{
8-
"answer": "To verify that the 'withdraw()' function updates the contract balance correctly.",
9-
"correct": true
8+
"answer": "To verify that the 'withdraw()' function updates other balances for the user correctly."
109
},
1110
{
12-
"answer": "To check if the contract is functioning correctly for non-owner users."
11+
"answer": "To check if the contract is working correctly for verified callers of the function.",
12+
"correct": true
1313
},
1414
{
1515
"answer": "To confirm the contract has sufficient funds before withdrawing."
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "The '.provider.getBalance(contract.getAddress())).to.equal()' lines in the tests:",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
5+
"answer": "verify the contract owner can provide an airdrop to an equal number of addresses."
76
},
87
{
9-
"answer": ""
8+
"answer": "check the contract balance to be greater than zero."
109
},
1110
{
12-
"answer": "",
11+
"answer": "ensure the contract balance is updated correctly after a function call.",
1312
"correct": true
1413
},
1514
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
15+
"answer": "confirm that the contract has sufficient funds before proceeding with the test."
2016
}
2117
]
2218
}

0 commit comments

Comments
 (0)