Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The wildcard for routes RegExp fails on optional parameters #75

Open
whitespacecode opened this issue Dec 14, 2022 · 1 comment
Open

Comments

@whitespacecode
Copy link

Right now the RegExp for wildcard parameters requires the wildcard to be exact

Using your example:

 cy.visit({
        route: 'team.dashboard',
        parameters: { team: 1 }
});

This will replace following
/teams/{team}/dashboard to /teams/1/dashboard

What if you have a route that have optional parameters

 cy.visit({
        route: 'team.dashboard.style',
        parameters: { team: 1, style: 3 }
});

/teams/{team}/dashboard/{style?} to /teams/1/dashboard/%7Bstyle%7D

@whitespacecode
Copy link
Author

I have fixed this in following pull request #76.
I made this pull request since i'm already using this fix on my codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant