@davoodmehraban89 / Factor-easy / commits / 779c122
Fork 0

سامانه صدور فاکتور و حسابداری

test: align signup identity label

Davood Mehraban committed Oct 7, 2026 at 22:38 UTC 779c12267e59fe4680e17fe5bf1f9cab7e18f7fa
1 file changed +3 -2
scripts/identity-wave5a.spec.js
+3 -2
@@ -1,4 +1,5 @@
1 -const {test,expect}=require('@playwright/test');
2 -test('Wave 5a exposes explicit OTP login and signup modes',async({page})=>{await page.goto('http://127.0.0.1:4173/index.html',{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>typeof startIdentityOtp==='function');expect(await page.getByRole('button',{name:'ورود با کد یک‌بارمصرف'}).count()).toBe(1);expect(await page.getByRole('button',{name:'ثبت‌نام با کد یک‌بارمصرف'}).count()).toBe(1);});
1 +const {test,expect}=require('@playwright/test');
2 +test('Wave 5a exposes explicit OTP login and signup modes',async({page})=>{await page.goto('http://127.0.0.1:4173/index.html',{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>typeof startIdentityOtp==='function');expect(await page.getByRole('button',{name:'ورود با کد یک‌بارمصرف'}).count()).toBe(1);expect(await page.getByRole('button',{name:'ثبت‌نام با ایمیل یا موبایل'}).count()).toBe(1);});
3 test('Wave 5a OTP login cannot silently create a user',async({page})=>{await page.goto('http://127.0.0.1:4173/index.html',{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>typeof startEmailOtp==='function');const result=await page.evaluate(async()=>{const calls=[],old=sb.auth.signInWithOtp,oldAlert=window.alert;window.alert=()=>{};sb.auth.signInWithOtp=async args=>{calls.push(args);return {error:null}};document.getElementById('auth-email').value='existing@example.com';try{await startEmailOtp(false,false);}finally{sb.auth.signInWithOtp=old;window.alert=oldAlert;}return calls;});expect(result).toEqual([{email:'existing@example.com',options:{shouldCreateUser:false}}]);});
4 test('Wave 5a explicit signup is the email OTP creation path',async({page})=>{await page.goto('http://127.0.0.1:4173/index.html',{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>typeof startEmailOtp==='function');const result=await page.evaluate(async()=>{const calls=[],old=sb.auth.signInWithOtp,oldAlert=window.alert;window.alert=()=>{};sb.auth.signInWithOtp=async args=>{calls.push(args);return {error:null}};document.getElementById('auth-email').value='new@example.com';try{await startEmailOtp(false,true);}finally{sb.auth.signInWithOtp=old;window.alert=oldAlert;}return calls;});expect(result).toEqual([{email:'new@example.com',options:{shouldCreateUser:true}}]);});
5 +