admin/constants/routes.test.ts
alisaza 82593dc18c refactor(events): update event management components and remove unused files
- Replaced `LIST_PUBLIC_CATEGORIES` with `LIST_ADMIN_CATEGORIES_FLAT` in `ArticleFormModal.tsx`.
- Removed the "Add Event" button from the dashboard page.
- Simplified the `EventsPage` by removing the button and adjusting the layout.
- Cleaned up the `AdminEventEditPage` by removing unnecessary props.
- Deleted unused layout and page files related to event creation.
- Updated `AdminAuthContent` to use `useAdminCitiesQuery` instead of `useDiscoveryCitiesQuery`.
- Refactored `EventGuestListAccessPanel` to remove the `accessMode` prop and adjust API calls accordingly.
- Removed several unused components and tests related to event creation, enhancing project maintainability.
2026-09-07 18:09:55 +03:30

24 lines
1.2 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { APP_ROUTES, CONSUMER_ROUTES, SEO_ROUTES } from '@/constants/routes'
describe('event route ownership', () => {
it('keeps admin event workflows under /manage-events', () => {
expect(APP_ROUTES.MANAGE_EVENTS).toBe('/manage-events')
expect(APP_ROUTES.MANAGE_EVENT_DETAIL('event/id')).toBe('/manage-events/event%2Fid')
expect(APP_ROUTES.MANAGE_EVENT_EDIT('event/id')).toBe('/manage-events/event%2Fid/edit')
})
it('keeps owner workflows under /my-events', () => {
expect(CONSUMER_ROUTES.EVENT_NEW).toBe('/my-events/new')
expect(CONSUMER_ROUTES.EVENT_MANAGE('event/id')).toBe('/my-events/event%2Fid/manage')
expect(CONSUMER_ROUTES.EVENT_EDIT('event/id')).toBe('/my-events/event%2Fid/manage/edit')
})
it('uses /e exclusively for public event details and checkout return state', () => {
expect(SEO_ROUTES.EVENT_LANDING('public/event')).toBe('/e/public%2Fevent')
expect(CONSUMER_ROUTES.EVENT_DETAIL('public/event')).toBe('/e/public%2Fevent')
expect(CONSUMER_ROUTES.EVENT_PAYMENT('public/event', 'booking/id')).toBe('/e/public%2Fevent?payment=checkout&bookingId=booking%2Fid')
})
})