| 12345678910111213141516171819202122232425262728293031323334 |
- import { PAGE_CATALOG } from './page-catalog';
- import { SOURCE_API_ACTIONS, SOURCE_EXTERNAL_CALLS, SOURCE_PAGE_PARITY } from './source-parity.generated';
- describe('uni-app source parity manifest', () => {
- it('keeps every original page registered exactly once', () => {
- const sourcePaths = SOURCE_PAGE_PARITY.map((page) => page.path).sort();
- const angularPaths = PAGE_CATALOG.map((page) => page.path).sort();
- expect(new Set(angularPaths).size).toBe(angularPaths.length);
- expect(angularPaths).toEqual(sourcePaths);
- });
- it('tracks the full source business surface', () => {
- expect(SOURCE_PAGE_PARITY.length).toBe(95);
- expect(SOURCE_API_ACTIONS.length).toBe(91);
- expect(SOURCE_API_ACTIONS).toContain('payment_cart_again');
- expect(SOURCE_API_ACTIONS).toContain('unit_record_update');
- expect(SOURCE_API_ACTIONS).toContain('user_group_usr_upgrade');
- });
- it('keeps dynamic source ranking actions and dedicated rich content rendering', () => {
- const ranking = PAGE_CATALOG.find((page) => page.path === 'pages/member/ranklist');
- const article = PAGE_CATALOG.find((page) => page.path === 'pages/home/enjoy_item');
- expect(ranking?.tabActions).toEqual(['ranklist_1', 'ranklist_2', 'ranklist_3', 'ranklist_4', 'ranklist_5']);
- expect(article?.kind).toBe('article');
- });
- it('tracks customer-service calls that bypass uni.$u.http', () => {
- expect(SOURCE_EXTERNAL_CALLS).toContain('bytedesk.rateDetail');
- expect(SOURCE_EXTERNAL_CALLS).toContain('bytedesk.rate');
- expect(SOURCE_EXTERNAL_CALLS).toContain('bytedesk.saveLeaveMessage');
- expect(PAGE_CATALOG.find((page) => page.path === 'components/bytedesk_kefu/rate')?.kind).toBe('supportFeedback');
- expect(PAGE_CATALOG.find((page) => page.path === 'components/bytedesk_kefu/leavemsg')?.kind).toBe('supportFeedback');
- });
- });
|