feat(whatsapp): QWEN primary AI backend, Hermes fallback, conversation history, vehicle persistence, demo prompts
- Add QWEN (qwen3.6) as primary AI backend with short system prompt - Hermes remains as fallback with 45s timeout - Increase QWEN timeout to 35s, max_tokens to 4000 - Add conversation history loading from whatsapp_messages (last 4 msgs) - Persist detected vehicle in whatsapp_sessions table - Add 'limpiar chat' / 'nuevo chat' / 'reset' commands to clear history - Fix CSS conflict: rename whatsapp chat-panel classes to wa-chat-panel - Fix JS ID conflicts with chat.js widget (waChatPanel, waChatMessages, etc.) - Improve no-stock response: conversational with alternatives - Split search_query by | for multi-part lookups - Add DEMO_PROMPTS.md and DEMO_PROMPTS_V2.md
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
test.describe('Nexus POS — Auth Guard', () => {
|
||||
test('unauthenticated user is redirected to login', async ({ browser }) => {
|
||||
// Create incognito context without localStorage
|
||||
const context = await browser.newContext();
|
||||
const page = await context.newPage();
|
||||
await page.goto('/pos/sale');
|
||||
await expect(page).toHaveURL(/\/pos\/login/);
|
||||
await context.close();
|
||||
});
|
||||
|
||||
test('login page is accessible without token', async ({ browser }) => {
|
||||
const context = await browser.newContext();
|
||||
const page = await context.newPage();
|
||||
test('unauthenticated user redirected to login', async ({ page }) => {
|
||||
// Ensure no auth state
|
||||
await page.goto('/pos/login');
|
||||
await expect(page.locator('input[type="password"], #password, input[name="pin"]')).toBeVisible();
|
||||
await context.close();
|
||||
await page.evaluate(() => {
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
});
|
||||
|
||||
await page.goto('/pos/sale');
|
||||
// app-init.js redirects to /pos/login when no token is found
|
||||
await expect(page).toHaveURL(/login/i, { timeout: 5000 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user