Baffling Test Error: Assignment 5

Hi there,

I’m having trouble with a single failing DOM test for assignment 5.

The test is checking to make sure the rocket isn’t ready to launch when the cargo mass is too heavy, and like the other tests, it tests the pilot status, copilot status, fuel status, and cargo status in turn. The test calls my formSubmission function with window.document, list, “Chris”, “Bob”, 10000, 100000.

All other tests pass, but this test fails at the 10000 passed as the value for fuelLevel. I’ve checked and rechecked myself on the webpage itself, and everything works as expected, but for some reason the test receives “Fuel level too low for launch” instead of “Fuel level high enough for launch” as the textContent of fuelStatus. This happens despite passing the tests ensuring that fuelStatus updates as expected. I haven’t changed any of the spec or bundle files associated with the automated tests.

Has anyone else encountered this kind of issue?

Thanks

Yes I did! It was tough to fix, unsure I actually understand how I fixed it or why what I did fixed it but essentially I had very “bare bones” conditionals in my function. Those absolutely worked when going off form inputs but I guess not when pushing number variables so I expanded all my conditionals & wrote out every possible scenario that the bottom div could be faced with as well as each required action (color + messaging changes). Very repetitive but it passed after that!

1 Like

Interesting, thanks for the explanation. My conditionals are pretty bare bones. I’ll take another look and see how I can expand them. Appreciate the help!