Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
How to write Unit Test case for Switch Statement that returns Component in Jest with React Testing Library

When I writing test case, I was able to reach out to case 0, but not able to reach other 1

const tabContent = (isCurrent) => {
    switch (isCurrent) {
      case 0:
        return <Component 1 />;
      case 1:
        return <Component 2 />;
      default:
        return null;
    }
  };

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Then set isCurrent to 1 to go to the first case tabContent(1) Any other value wil go to the default

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!