diff --git a/web/app/components/app/app-publisher/__tests__/menu-content.spec.tsx b/web/app/components/app/app-publisher/__tests__/menu-content.spec.tsx new file mode 100644 index 0000000000..939725d97a --- /dev/null +++ b/web/app/components/app/app-publisher/__tests__/menu-content.spec.tsx @@ -0,0 +1,244 @@ +import type { AppPublisherMenuContentProps } from '../menu-content.types' +import type { AppDetailResponse } from '@/models/app' +import type { SystemFeatures } from '@/types/feature' +import { render, screen } from '@testing-library/react' +import userEvent from '@testing-library/user-event' +import { describe, expect, it, vi } from 'vitest' +import { toast } from '@/app/components/base/ui/toast' +import { AccessMode } from '@/models/access-control' +import { AppModeEnum } from '@/types/app' +import { defaultSystemFeatures } from '@/types/feature' +import MenuContent from '../menu-content' + +vi.mock('@/app/components/base/ui/toast', () => ({ + toast: { + error: vi.fn(), + }, +})) + +vi.mock('@/app/components/billing/upgrade-btn', () => ({ + default: () =>
- {t('publishLimit.startNodeTitlePrefix', { ns: 'workflow' })} - {t('publishLimit.startNodeTitleSuffix', { ns: 'workflow' })} -
-- {t('publishLimit.startNodeDesc', { ns: 'workflow' })} -
-{t('publishApp.title', { ns: 'app' })}
-{t('publishApp.notSet', { ns: 'app' })}
} -{t('publishApp.notSetDesc', { ns: 'app' })}
} -{t('publishApp.title', { ns: 'app' })}
+{t('publishApp.notSet', { ns: 'app' })}
} +{t('publishApp.notSetDesc', { ns: 'app' })}
} ++ {t('publishLimit.startNodeTitlePrefix', { ns: 'workflow' })} + {t('publishLimit.startNodeTitleSuffix', { ns: 'workflow' })} +
++ {t('publishLimit.startNodeDesc', { ns: 'workflow' })} +
+