46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
import { processConversationalInstruction } from '../src/services/aiEngine';
|
|
import { BusinessProfile, WebsiteSection } from '../src/types';
|
|
|
|
const mockProfile: BusinessProfile = {
|
|
companyName: 'Apex Pools',
|
|
phone: '(555) 123-4567',
|
|
email: 'test@example.com',
|
|
address: '123 Main St',
|
|
city: 'Dallas',
|
|
state: 'TX',
|
|
zip: '75001',
|
|
industry: 'Pool Service',
|
|
tagline: 'Best in TX',
|
|
yearsInBusiness: '10',
|
|
services: ['Weekly Chemical Balancing & Skimming'],
|
|
emergencyService: true,
|
|
theme: 'titan-navy',
|
|
colorMode: 'dark'
|
|
};
|
|
|
|
const mockSections: WebsiteSection[] = [];
|
|
|
|
console.log('--- TESTING COLOR MODE DETECTION ---');
|
|
|
|
// Test 1: Light mode instruction
|
|
const r1 = processConversationalInstruction('switch to light mode', mockSections, mockProfile);
|
|
console.log('Test 1 (switch to light mode):', r1.updatedProfile?.colorMode === 'light' && !r1.updatedTheme ? '✅ PASS' : '❌ FAIL');
|
|
|
|
// Test 2: Dark mode instruction
|
|
const r2 = processConversationalInstruction('make it dark mode', mockSections, mockProfile);
|
|
console.log('Test 2 (make it dark mode):', r2.updatedProfile?.colorMode === 'dark' && !r2.updatedTheme ? '✅ PASS' : '❌ FAIL');
|
|
|
|
// Test 3: Dual light mode + theme
|
|
const r3 = processConversationalInstruction('switch to light mode in emerald green', mockSections, mockProfile);
|
|
console.log('Test 3 (light + emerald):', r3.updatedProfile?.colorMode === 'light' && r3.updatedTheme === 'emerald-slate' ? '✅ PASS' : '❌ FAIL');
|
|
|
|
// Test 4: Dual dark mode + gold theme
|
|
const r4 = processConversationalInstruction('change to dark mode with gold and black', mockSections, mockProfile);
|
|
console.log('Test 4 (dark + gold):', r4.updatedProfile?.colorMode === 'dark' && r4.updatedTheme === 'obsidian-gold' ? '✅ PASS' : '❌ FAIL');
|
|
|
|
// Test 5: Pure color prompt preserves profile
|
|
const r5 = processConversationalInstruction('theme black and yellow', mockSections, mockProfile);
|
|
console.log('Test 5 (theme black and yellow):', r5.updatedTheme === 'obsidian-gold' ? '✅ PASS' : '❌ FAIL');
|
|
|
|
console.log('🎉 All color mode tests passed!');
|