Foundation Certificate in Test Automation- 3.1.2 Review Failed Checks. - code not doing what I was hoping

Hello-
I’ve got to Activity 3.1.2 Review Failed Checks on the foundation course for JS.

  • I run npm start and it loads up the project
  • npm test runs the test list- it only appears to run anything in src/__tests__
  • It looks like there are three tests running…
  1. examplecomponent.test.js (should pass)
  2. projectlist.test.js (which also should pass)
  3. I’ve imported login.test.js which isn’t supposed to pass (from my course notes)

I’m supposed to work out why it’s not passing.
Further to this I am getting a console error (as below)
â—Ź Console

console.error
      Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
          at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:280:3)
          at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/src/components/Login.js:6:39)
          at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:413:13)
          at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:219:3)

It’s also saying i’ve passed 3 suites but 4 tests- which is confusing. (screenshot attached) If anyone can explain the difference between the Suites/ Tests/ Snapshots, I’d be greatful.

I don’t think that the files under the test folder are actually testing -I’m not sure what is going on with why/ how i get them to run

I’ve added screenshots for any additional help with this. I’m a bit lost!

To be extra helpful my code can be found here

Thank you so much in advance, I’m very lost!

3 Likes

I’m also very aware that my code isn’t compiling in Github as well if anyone has any ideas there!

3 Likes

Update: I’ve had a chat with one of our developers who has helped me a bit. I’ve ran npm run wdio which runs the E2E tests- but I noticed it needed to be in the test/specs folder for it to work, and now, huzzah- failing test.

Still unsure as to why the projectliste.test.js is working, but much happier for that one!

2 Likes

Not sure if anyone has had any ideas, I’m going to assume that it’s not compiling because the tests are failing?
If anyone can confirm why login.test.js is passing when it shouldn’t (maybe someone that has done the course) I’d be greatful!

1 Like

Hi @kelly.kenyon

So I looked into this and the reason it was passing was because I had made a mistake in the test. I’ve updated the check to indeed fail now and will be asking the team to update the course. I’ll ask them to let you know when this has been done. Apologies!

2 Likes

Im guessing that you have 3 test files and across those 3 files you have 4 tests. A suite is a feature like you have login.test.js thats a suite then within there you can have 2 tests 1 success login, 1 failed login for example.

A Suite can have many tests but a test can only belong to 1 Suite

1 Like

Hi @kelly.kenyon

Mark’s updates have been added to the course.

All the best,

Sarah

1 Like