|
|
@@ -262,7 +262,7 @@ describe('支付页面额度支付功能测试', () => {
|
|
|
expect(screen.getByTestId('pay-button')).toHaveTextContent('额度支付 ¥100.00')
|
|
|
})
|
|
|
|
|
|
- test('选择额度支付时应该显示额度详情(不显示可用额度)', async () => {
|
|
|
+ test('选择额度支付时应该显示额度说明(不显示额度详情)', async () => {
|
|
|
// Mock 额度查询返回正常数据
|
|
|
const mockCreditBalance = createTestCreditBalance()
|
|
|
;(creditBalanceClient.me.$get as jest.Mock).mockResolvedValue({
|
|
|
@@ -285,17 +285,17 @@ describe('支付页面额度支付功能测试', () => {
|
|
|
const creditOption = screen.getByTestId('credit-payment-option')
|
|
|
fireEvent.click(creditOption)
|
|
|
|
|
|
- // 验证显示额度详情(不包含可用额度)
|
|
|
+ // 验证显示额度说明(不包含额度详情)
|
|
|
await waitFor(() => {
|
|
|
// 使用data-testid查询额度详情容器
|
|
|
const creditDetails = screen.getByTestId('credit-payment-details')
|
|
|
expect(creditDetails).toBeInTheDocument()
|
|
|
|
|
|
- // 验证容器中包含额度信息(不包含可用额度)
|
|
|
+ // 验证容器中包含基本说明(不包含额度详情)
|
|
|
expect(creditDetails).toHaveTextContent(/使用信用额度支付,无需立即付款/)
|
|
|
- expect(creditDetails).toHaveTextContent(/总额度: ¥1000\.00/)
|
|
|
- expect(creditDetails).toHaveTextContent(/已用额度: ¥200\.00/)
|
|
|
- // 不应该包含可用额度
|
|
|
+ // 不应该包含额度详情
|
|
|
+ expect(creditDetails).not.toHaveTextContent(/总额度:/)
|
|
|
+ expect(creditDetails).not.toHaveTextContent(/已用额度:/)
|
|
|
expect(creditDetails).not.toHaveTextContent(/可用额度:/)
|
|
|
})
|
|
|
})
|