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

310
Views
TypeError: Cannot read properties of undefined (reading 'pop') JS Testing Error

Hello I am trying to test my JavaScript Project and am trying to test to make sure this one button works in the code and I am getting this error that I cannot find any answers on. I cannot figure out why reading pop is undefined

Error Message

 TypeError: Cannot read properties of undefined (reading 'pop')

      30 |       </TopContainer>
      31 |       <NavContainer >
    > 32 |       <BackLogoButton id="backButton" onPress={() => navigation.pop(1)}>
         |                                                                 ^
      33 |           <BackLogo source={require('./../assets/back-logo.png')}/>
      34 |         </BackLogoButton>
      35 |       </NavContainer>

Test Code

describe('Tests the BackLogoButton in Tutorial pages', () => {
  it('BackLogoButton is pressable', () => {
    const onPressEvent = jest.fn();
    const wrapper = shallow(<BackLogoButton onPress={onPressEvent}/>);
    onPressEvent.mockReturnValue('');
    wrapper.find('#backButton').first().props().onPress();
    expect(onPressEvent.mock.calls.length).toBe(0);
  });
});
about 4 years ago · Juan Pablo Isaza
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!