feat(addons): finalize event addon catalog and ai styling upgrade flow
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-07 12:35:07 +01:00
parent 8cc0918881
commit d2808ffa4f
36 changed files with 1372 additions and 457 deletions

View File

@@ -153,6 +153,7 @@ vi.mock('../invite-layout/export-utils', () => ({
vi.mock('../../api', () => ({
getEvent: vi.fn(),
getAddonCatalog: vi.fn().mockResolvedValue([]),
getTenantPackagesOverview: vi.fn().mockResolvedValue({ packages: [], activePackage: null }),
getTenantBillingTransactions: vi.fn().mockResolvedValue({
data: [
@@ -199,6 +200,7 @@ describe('MobileBillingPage', () => {
} as any);
vi.mocked(api.getTenantAddonHistory).mockResolvedValue({ data: [] } as any);
vi.mocked(api.getEvent).mockResolvedValue(null as any);
vi.mocked(api.getAddonCatalog).mockResolvedValue([]);
});
it('shows current event scoped entitlements separately from tenant history', async () => {
@@ -480,4 +482,39 @@ describe('MobileBillingPage', () => {
expect(triggerDownloadMock).toHaveBeenCalled();
});
});
it('offers a direct add-on purchase entry in billing for the selected event', async () => {
eventContext.activeEvent = {
id: 99,
slug: 'fruehlingsfest',
name: { de: 'Frühlingsfest' },
};
vi.mocked(api.getEvent).mockResolvedValueOnce({
id: 99,
slug: 'fruehlingsfest',
name: { de: 'Frühlingsfest' },
event_date: null,
event_type_id: null,
event_type: null,
status: 'published',
settings: {},
package: null,
addons: [],
limits: null,
member_permissions: [],
} as any);
vi.mocked(api.getAddonCatalog).mockResolvedValueOnce([
{
key: 'extend_gallery_30d',
label: 'Galerie +30 Tage',
price_id: 'paypal',
increments: { extra_gallery_days: 30 },
},
] as any);
render(<MobileBillingPage />);
expect(await screen.findByText('Buy add-ons for this event')).toBeInTheDocument();
});
});