Procházet zdrojové kódy

稳定桌面登录后的页面验收并补齐 Windows 升级会话模拟

Samien před 1 měsícem
rodič
revize
5ca17aaa9a

+ 2 - 0
desktop/test-support/onboarding.mjs

@@ -9,4 +9,6 @@ export async function enterLocal(page, { username = 'desktop-fixture', password
       body: JSON.stringify({username,currentPassword:'',newPassword:password}) })
     if (!response.ok) throw new Error('Fixture account configuration failed')
   }, {username,password})
+  // Reload after credential rotation so callers attach to the final authorized document.
+  await page.goto(new URL('/conversations', page.url()).href)
 }

+ 4 - 0
desktop/windows-upgrade.test.mjs

@@ -31,6 +31,10 @@ test('installed NSIS client rejects a corrupt update, upgrades and preserves set
   const server = createServer(async (req, res) => {
     try {
       const path = new URL(req.url, 'http://localhost').pathname
+      if (path === '/api/app/desktop-session') {
+        res.setHeader('Set-Cookie', 'hermes_yaoyao_session=fixture; Path=/; HttpOnly; Max-Age=31536000')
+        res.setHeader('Content-Type', 'application/json'); res.end('{}'); return
+      }
       if (path === '/api/app/bootstrap') {
         const authenticated = !requireCookie || String(req.headers.cookie).includes('session=upgrade-fixture')
         if (requireCookie && authenticated) restored++