mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-05-06 07:58:00 +00:00
43 lines
1015 B
TypeScript
43 lines
1015 B
TypeScript
import '@testing-library/jest-dom';
|
|
import { vi } from 'vitest';
|
|
|
|
// Mock Telegram WebApp
|
|
Object.defineProperty(window, 'Telegram', {
|
|
value: {
|
|
WebApp: {
|
|
ready: vi.fn(),
|
|
expand: vi.fn(),
|
|
close: vi.fn(),
|
|
setHeaderColor: vi.fn(),
|
|
setBackgroundColor: vi.fn(),
|
|
showAlert: vi.fn(),
|
|
showConfirm: vi.fn(),
|
|
initData: '',
|
|
initDataUnsafe: {
|
|
user: {
|
|
id: 123456789,
|
|
first_name: 'Test',
|
|
last_name: 'User',
|
|
username: 'testuser',
|
|
language_code: 'ku',
|
|
},
|
|
},
|
|
HapticFeedback: {
|
|
impactOccurred: vi.fn(),
|
|
notificationOccurred: vi.fn(),
|
|
selectionChanged: vi.fn(),
|
|
},
|
|
openLink: vi.fn(),
|
|
openTelegramLink: vi.fn(),
|
|
version: '7.0',
|
|
platform: 'web',
|
|
themeParams: {},
|
|
},
|
|
},
|
|
writable: true,
|
|
});
|
|
|
|
// Mock environment variables
|
|
vi.stubEnv('VITE_SUPABASE_URL', 'https://test.supabase.co');
|
|
vi.stubEnv('VITE_SUPABASE_ANON_KEY', 'test-key');
|