@@ -96,11 +96,11 @@ describe('SignupPage', () => {
9696 const passwordInput = screen . getByPlaceholderText ( / e n t e r y o u r p a s s w o r d / i)
9797
9898 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
99- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
99+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
100100 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
101101
102102 expect ( nameInput ) . toHaveValue ( 'John Doe' )
103- expect ( emailInput ) . toHaveValue ( 'test@example .com' )
103+ expect ( emailInput ) . toHaveValue ( 'user@company .com' )
104104 expect ( passwordInput ) . toHaveValue ( 'Password123!' )
105105 } )
106106
@@ -118,7 +118,7 @@ describe('SignupPage', () => {
118118 const submitButton = screen . getByRole ( 'button' , { name : / c r e a t e a c c o u n t / i } )
119119
120120 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
121- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
121+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
122122 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
123123 fireEvent . click ( submitButton )
124124
@@ -144,14 +144,14 @@ describe('SignupPage', () => {
144144
145145 // Use valid input that passes all validation rules
146146 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
147- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
147+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
148148 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
149149 fireEvent . click ( submitButton )
150150
151151 await waitFor ( ( ) => {
152152 expect ( mockSignUp ) . toHaveBeenCalledWith (
153153 {
154- email : 'test@example .com' ,
154+ email : 'user@company .com' ,
155155 password : 'Password123!' ,
156156 name : 'John Doe' ,
157157 } ,
@@ -174,7 +174,7 @@ describe('SignupPage', () => {
174174
175175 // Use name with leading/trailing spaces which should fail validation
176176 fireEvent . change ( nameInput , { target : { value : ' John Doe ' } } )
177- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
177+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
178178 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
179179 fireEvent . click ( submitButton )
180180
@@ -206,15 +206,13 @@ describe('SignupPage', () => {
206206 const submitButton = screen . getByRole ( 'button' , { name : / c r e a t e a c c o u n t / i } )
207207
208208 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
209- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
209+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
210210 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
211211 fireEvent . click ( submitButton )
212212
213213 await waitFor ( ( ) => {
214- expect ( mockSendOtp ) . toHaveBeenCalledWith ( {
215- 216- type : 'email-verification' ,
217- } )
214+ // With sendVerificationOnSignUp: true, OTP is sent automatically by Better Auth
215+ // No manual OTP sending in the component anymore
218216 expect ( mockRouter . push ) . toHaveBeenCalledWith ( '/verify?fromSignup=true' )
219217 } )
220218 } )
@@ -267,7 +265,7 @@ describe('SignupPage', () => {
267265 const submitButton = screen . getByRole ( 'button' , { name : / c r e a t e a c c o u n t / i } )
268266
269267 fireEvent . change ( nameInput , { target : { value : longName } } )
270- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
268+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
271269 fireEvent . change ( passwordInput , { target : { value : 'ValidPass123!' } } )
272270 fireEvent . click ( submitButton )
273271
@@ -295,7 +293,7 @@ describe('SignupPage', () => {
295293 const submitButton = screen . getByRole ( 'button' , { name : / c r e a t e a c c o u n t / i } )
296294
297295 fireEvent . change ( nameInput , { target : { value : exactLengthName } } )
298- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
296+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
299297 fireEvent . change ( passwordInput , { target : { value : 'ValidPass123!' } } )
300298 fireEvent . click ( submitButton )
301299
@@ -308,7 +306,7 @@ describe('SignupPage', () => {
308306 await waitFor ( ( ) => {
309307 expect ( mockSignUp ) . toHaveBeenCalledWith (
310308 {
311- email : 'test@example .com' ,
309+ email : 'user@company .com' ,
312310 password : 'ValidPass123!' ,
313311 name : exactLengthName ,
314312 } ,
@@ -343,7 +341,7 @@ describe('SignupPage', () => {
343341
344342 await act ( async ( ) => {
345343 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
346- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
344+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
347345 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
348346 fireEvent . click ( submitButton )
349347 } )
@@ -385,12 +383,12 @@ describe('SignupPage', () => {
385383 const submitButton = screen . getByRole ( 'button' , { name : / c r e a t e a c c o u n t / i } )
386384
387385 fireEvent . change ( nameInput , { target : { value : 'John Doe' } } )
388- fireEvent . change ( emailInput , { target : { value : 'test@example .com' } } )
386+ fireEvent . change ( emailInput , { target : { value : 'user@company .com' } } )
389387 fireEvent . change ( passwordInput , { target : { value : 'Password123!' } } )
390388 fireEvent . click ( submitButton )
391389
392390 await waitFor ( ( ) => {
393- expect ( mockRouter . push ) . toHaveBeenCalledWith ( '/invite/123 ' )
391+ expect ( mockRouter . push ) . toHaveBeenCalledWith ( '/verify?fromSignup=true ' )
394392 } )
395393 } )
396394
0 commit comments