feat: complete AI analytics experience
This commit is contained in:
22
src/lib/components/TransactionStatusChart.test.ts
Normal file
22
src/lib/components/TransactionStatusChart.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { render, screen } from '@testing-library/svelte';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import TransactionStatusChart from './TransactionStatusChart.svelte';
|
||||
|
||||
describe('TransactionStatusChart', () => {
|
||||
it('renders canonical labels, exact accessible values, and a data-table alternative', () => {
|
||||
render(TransactionStatusChart, {
|
||||
data: [
|
||||
{ status: 'Verified', count: 60, sharePercent: '60' },
|
||||
{ status: 'Failed', count: 20, sharePercent: '20' },
|
||||
{ status: 'Paid', count: 10, sharePercent: '10' },
|
||||
{ status: 'Reversed', count: 10, sharePercent: '10' },
|
||||
],
|
||||
});
|
||||
|
||||
expect(screen.getByRole('button', { name: /پرداختشده، در انتظار تأیید، ۱۰ تراکنش، ۱۰٪/ })).toBeTruthy();
|
||||
expect(screen.getByRole('button', { name: /تأیید نهایی، ۶۰ تراکنش، ۶۰٪/ })).toBeTruthy();
|
||||
expect(screen.getByText('جدول دادههای نمودار وضعیت')).toBeTruthy();
|
||||
expect(screen.getByRole('table')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user