https://cypress.io logo
Hello everyone. I am trying to run Cypress and exe...
# help
c
Hello everyone. I am trying to run Cypress and execute the URL with an ID (eg: 1). However, I cannot manage to do so and I am always getting an undefined instead in the url. How can I actually access that path? I use a custom page loader and I am not sure if that changes anything Here is the .cy.tsx file:
Copy code
typescript
describe('CompanyDetails.cy.ts', () => {
  it('should render', () => {
    cy.mount(<CompanyDetails />, '/company/1')
  })
})
And here is component.tsx file:
Copy code
typescript
Cypress.Commands.add('mount', (Component, initialRoute = '/company/1', path, options = {}) => {
  const wrapped = <MemoryRouter initialEntries={['companies/1']}> {Component} </MemoryRouter>
  return mount(wrapped)
})
Do you have any idea what am I doing wrong? Thanks!
2 Views