import { renderToStaticMarkup } from 'react-dom/server'
import { describe, expect, it, vi } from 'vitest'
import { SourceSettingsCard, SourceRefreshPolicy, SourceSettingsAudit } from './SourceManagement'
import type { SourceConnectionListItem } from './sourceConnections'
const row = {
id: 's1',
name: '测试来源',
source_type: 'dingtalk',
enabled: false,
schedule_configured: true,
next_refresh_at: null,
} as SourceConnectionListItem
describe('source management separation', () => {
it('keeps schedule editors, authorization and audit out of source rows', () => {
const html = renderToStaticMarkup()
expect(html).toContain('自动刷新已暂停')
for (const text of ['保存设置', '自动刷新周期', '扫码刷新会话', '修订历史']) expect(html).not.toContain(text)
})
it('has a single shared period selector without silently resuming sources', () => {
const html = renderToStaticMarkup()
expect((html.match(/