优化
This commit is contained in:
@@ -53,6 +53,7 @@ describe('CustomerDetailView', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
vi.stubGlobal('ResizeObserver', ResizeObserverStub)
|
||||
Object.defineProperty(HTMLElement.prototype, 'scrollIntoView', { configurable: true, value: vi.fn() })
|
||||
Object.defineProperty(URL, 'createObjectURL', { configurable: true, value: vi.fn(() => 'blob:qualification-preview') })
|
||||
Object.defineProperty(URL, 'revokeObjectURL', { configurable: true, value: vi.fn() })
|
||||
document.body.innerHTML = ''
|
||||
@@ -82,6 +83,13 @@ describe('CustomerDetailView', () => {
|
||||
expect(document.body.textContent).not.toContain('0 人正常使用')
|
||||
expect(document.body.textContent).toContain('已替换')
|
||||
expect(document.body.textContent).toContain('12票')
|
||||
|
||||
const billingTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
|
||||
.find((button) => button.textContent?.trim() === '计费规则')
|
||||
billingTab?.click()
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('暂无计费规则查看权限')
|
||||
expect(document.body.textContent).not.toContain('计费规则尚未接入')
|
||||
})
|
||||
|
||||
it('opens an authenticated qualification preview', async () => {
|
||||
|
||||
Reference in New Issue
Block a user