I've been following the tutorial and everything has been going okay except for a couple of things:
I can't pass the last 3 truffle tests and the candidates don't show in the dropdown so I can't vote. Any ideas?
Contract: Election
√ initializes with two candidates (244ms)
√ it initializes the candidates with the correct values (359ms)
2 passing (957ms)
3 failing
1) allows a voter to cast a vote:
ReferenceError: accounts is not defined
at C:\Users\Tammy\election\test\election.js:35:55
at processTicksAndRejections (node:internal/process/task_queues:94:5)
2) vote fails for invalid candiates:
ReferenceError: accounts is not defined
at C:\Users\Tammy\election\test\election.js:53:46
at processTicksAndRejections (node:internal/process/task_queues:94:5)
3) vote fails for double voting:
ReferenceError: accounts is not defined
at C:\Users\Tammy\election\test\election.js:71:48
at processTicksAndRejections (node:internal/process/task_queues:94:5)
Update! Did some digging around other issues posted here about this tutorial and found an updated app.js file submitted by @DongsubShim. Now my candidates show in the dropdown and I can vote!
I've been following the tutorial and everything has been going okay except for a couple of things: I can't pass the last 3 truffle tests and the candidates don't show in the dropdown so I can't vote. Any ideas?
Contract: Election √ initializes with two candidates (244ms) √ it initializes the candidates with the correct values (359ms)
2 passing (957ms) 3 failing
1) allows a voter to cast a vote: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:35:55 at processTicksAndRejections (node:internal/process/task_queues:94:5)
2) vote fails for invalid candiates: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:53:46 at processTicksAndRejections (node:internal/process/task_queues:94:5)
3) vote fails for double voting: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:71:48 at processTicksAndRejections (node:internal/process/task_queues:94:5)