Files
EventHubFrontAdmin/e2e/mocks/contentSeed.ts
T
aleksey 7bd186eace
CI / test (push) Has been cancelled
CI / push-image (push) Has been cancelled
CI / ci-done (push) Has been cancelled
fix(e2e): интеграционные тесты на стендах без mocks.
ift-ui/stage-ui гоняют stand/integration против живого API; mock-suite остаётся в CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 14:11:54 +03:00

152 lines
3.9 KiB
TypeScript

/** Content/system seed data for mock E2E (users, calendars, events, …). */
const now = '2026-07-14T12:00:00Z';
export function createContentSeed() {
const users = [
{
id: 'user-e2e-1',
email: 'alice@eventhub.local',
nickname: 'Alice',
role: 'user',
status: 'active',
language: 'ru',
phone: null,
avatar_url: null,
last_login: now,
created_at: now,
updated_at: now,
},
{
id: 'user-e2e-2',
email: 'bob@eventhub.local',
nickname: 'Bob',
role: 'user',
status: 'frozen',
language: 'en',
phone: null,
avatar_url: null,
last_login: now,
created_at: now,
updated_at: now,
},
];
const calendars = [
{
id: 'cal-e2e-1',
title: 'E2E Calendar',
description: 'for tests',
type: 'personal',
category: 'sport',
owner_id: 'user-e2e-1',
status: 'active',
reason: null,
tags: [],
color: '#3366ff',
image_url: '',
rating_avg: 4.5,
rating_count: 2,
short_name: 'e2ecal',
confirmation: 'none',
settings: null,
created_at: now,
updated_at: now,
},
];
const events = [
{
id: 'evt-e2e-1',
calendar_id: 'cal-e2e-1',
title: 'E2E Workout',
description: 'test event',
event_type: 'single',
start_time: '2026-01-01T10:00:00Z',
duration: 60,
recurrence: null,
master_id: null,
is_instance: false,
specialist_id: null,
location: null,
tags: [],
capacity: 10,
online_link: null,
status: 'active',
reason: null,
rating_avg: 5,
rating_count: 1,
created_at: now,
updated_at: now,
},
];
const subscriptions = [
{
id: 'sub-e2e-1',
user_id: 'user-e2e-1',
plan: 'monthly',
status: 'active',
trial_used: false,
started_at: now,
expires_at: '2027-01-01T00:00:00Z',
auto_renew: true,
created_at: now,
updated_at: now,
},
];
const bannedWords = [
{ word: 'spamword', added_by: 'admin-e2e-1', added_at: now },
{ word: 'badword', added_by: 'admin-e2e-1', added_at: now },
];
const admins = [
{
id: 'admin-e2e-1',
email: 'e2e@eventhub.local',
nickname: 'E2E Admin',
role: 'superadmin',
language: 'ru',
phone: null,
avatar_url: null,
timezone: 'Europe/Moscow',
created_at: now,
updated_at: now,
last_login: now,
},
{
id: 'admin-e2e-2',
email: 'mod@eventhub.local',
nickname: 'Mod Admin',
role: 'moderator',
language: 'ru',
phone: null,
avatar_url: null,
timezone: 'UTC',
created_at: now,
updated_at: now,
last_login: now,
},
];
const audit = [
{
id: 'audit-e2e-1',
admin_id: 'admin-e2e-1',
email: 'e2e@eventhub.local',
role: 'superadmin',
action: 'update_user',
entity_type: 'user',
entity_id: 'user-e2e-1',
timestamp: now,
ip: '127.0.0.1',
reason: 'e2e',
},
];
return { users, calendars, events, subscriptions, bannedWords, admins, audit };
}
export type ContentState = ReturnType<typeof createContentSeed>;