feat: complete AI analytics experience

This commit is contained in:
2026-08-22 15:47:26 +08:00
parent 2bea50a291
commit 43f65a8259
35 changed files with 3497 additions and 574 deletions

View 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();
});
});