import { describe, expect, it } from 'vitest';
import { platformOperations } from '../api/platform-operations.generated';
import { businessPageForOperation } from './business-definitions';

describe('平台业务页面覆盖', () => {
  it('除经营概览外，每个 OpenAPI 平台接口只属于一个业务页面', () => {
    const operations = platformOperations.filter((operation) => operation.path !== '/api/platform-admin/overview');
    expect(operations.map((operation) => [operation.id, businessPageForOperation(operation).length])).toEqual(
      operations.map((operation) => [operation.id, 1]),
    );
  });
});
