test: add credits→pay reverse sync test and harden max-boundary assertion

Add credits-driven sync test covering the creditsModel setter reverse
path. Harden max-boundary test with blur + credits clamp assertion to
catch pay/credits desync bugs.
This commit is contained in:
Glary-Bot
2026-04-20 03:36:17 +00:00
committed by bymyself
parent 81f604edf8
commit fe69964ef5

View File

@@ -130,12 +130,24 @@ test.describe('Top Up Credits Dialog', { tag: '@ui' }, () => {
await expect(dialog.creditsInput).toHaveValue(expectedCredits(500))
})
test('typing in credits stepper updates pay', async () => {
const credits = String(50 * CREDITS_PER_USD)
await dialog.creditsInput.fill('')
await dialog.creditsInput.pressSequentially(credits)
await dialog.creditsInput.blur()
await expect(dialog.payInput).toHaveValue('50')
})
test('max ceiling warning appears when exceeding max', async () => {
await dialog.payInput.fill('')
await dialog.payInput.pressSequentially('99999')
await dialog.payInput.blur()
await expect(dialog.ceilingWarning).toBeVisible()
await expect(dialog.payInput).toHaveValue('10,000')
await expect(dialog.creditsInput).toHaveValue(expectedCredits(10_000))
})
test('min amount warning appears for values below minimum', async () => {