feat(addons): finalize event addon catalog and ai styling upgrade flow
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user