mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-10-28 16:46:57 +08:00
fix(logs): vertically align billing source icons on mobile (#7760)
This commit is contained in:
1 parent
3f926c3ef4
commit
bbf60b49f6
2 files changed
+22
-1
No files matched your search
@@ -147,6 +147,27 @@ describe('log cost display', () => {
|
||||
expect(screen.getByRole('img', { name: 'Subscription' })).toBeVisible()
|
||||
})
|
||||
|
||||
test.each([
|
||||
{ source: 'subscription', label: 'Subscription' },
|
||||
{ source: 'wallet', label: 'Wallet' },
|
||||
])(
|
||||
'vertically centers the $source icon within its container',
|
||||
({ source, label }) => {
|
||||
renderCost({
|
||||
quota: 5000,
|
||||
other: { billing_source: source },
|
||||
showBillingSource: true,
|
||||
})
|
||||
|
||||
// Mobile cards give inline-flex descendants a minimum height, so the
|
||||
// source container must center its smaller icon independently of the badge.
|
||||
expect(screen.getByRole('img', { name: label })).toHaveClass(
|
||||
'inline-flex',
|
||||
'items-center'
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
test.each([
|
||||
{ source: 'subscription', label: 'Subscription' },
|
||||
{ source: 'wallet', label: 'Wallet' },
|
||||
|
||||
@@ -115,7 +115,7 @@ export function LogCostDisplay(props: LogCostDisplayProps) {
|
||||
<TooltipTrigger
|
||||
render={
|
||||
<span
|
||||
className='inline-flex shrink-0 cursor-help'
|
||||
className='inline-flex shrink-0 cursor-help items-center'
|
||||
role='img'
|
||||
aria-label={source}
|
||||
tabIndex={0}
|
||||
|
||||
Reference in new issue
Block a user