๐ฉโ๐ป Join our community of thousands of amazing developers!
Let's take a button component that directs the browser to an external site.src/Login.tsx1234567891011export const LoginBtn = () => { const handleSubmit = () => { location.assign('https://cypress.tips') } return ( <button onClick={handleSubmit} data-cy="login-button"> Log in </button> )}๐ You can find the full source code shown in this blog post in the repo bahmutov/stub-location. Even better, this example and lots more React Cypress component tests are shown in the huge repo mu...