Example "Sudoku Solver" project has: ReferenceError: setGrid is not defined

Hi!
There some issues with the sample “Sudoku Solver” project.
Could you check, please?
Should I add an issue here https://github.com/FreeCodeCamp/freecodecamp/issues?

Description:
There is an issue “ReferenceError: setGrid is not defined” in “Sudoku Solver” https://sudoku-solver--freecodecamp.repl.co/ example project when a user enters/changes/removes data inside . Also, if data inside textarea was changed no changes apply to the sudoku grid. I suppose the second issue is because of the first.

I have: Firefox 79.0 (64-bit, macOS Catalina 10.15.6

Steps:

  1. Go to -> https://sudoku-solver--freecodecamp.repl.co/
  2. Open Dev Tools -> Console in browser
  3. Go to the page and find the textarea with the sample sudoku string and two buttons (Solve and Clear)
  4. Change data inside the textarea: remove/change/add any symbol.
    (I removed last 34 positions)
  5. Check the console for errors, check sudoku grid for changes

Actual result:
You can see an error in console.

Uncaught ReferenceError: setGrid is not defined
oninput https://sudoku-solver--freecodecamp.repl.co/:1
sudoku-solver–freecodecamp.repl.co:1:1
Uncaught ReferenceError: setGrid is not defined
oninput https://sudoku-solver--freecodecamp.repl.co/:1

The grid is not updated after changes

Expected result:
No error “setGrid is not defined”.
If data inside textarea was changed then valid changes should be applied to the grid.

1 Like

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

I was confused when doing this as well, the first two tests don’t seem to be implemented correctly in the example project.

I’m also confused by the tests in this project. Suddenly we have to use JSDOM which I haven’t seen in the curriculum. I’ve already completed the app and I could figure out how to do unit tests, but the functional testing is rough. I can’t seem to fire UI events.
Some unit tests don’t even seem necessary to complete the project, like testing a full grid being valid.

I’m just leaving the tests for now. I think I’ll come back to them at some point, maybe using something like Zombie which is actually taught in the curriculum…

Yeah. They won’t pass the automated tests but it makes more sense and good learning experience. Good luck!

1 Like

Thanks man, you too!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.