23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { render, screen } from '@testing-library/svelte';
|
||
import { describe, expect, it } from 'vitest';
|
||
|
||
import TransactionStatusChart from './TransactionStatusChart.svelte';
|
||
|
||
describe('TransactionStatusChart', () => {
|
||
it('renders canonical labels and exact accessible values without a duplicate data table', () => {
|
||
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.queryByText('جدول دادههای نمودار وضعیت')).toBeNull();
|
||
expect(screen.queryByRole('table')).toBeNull();
|
||
});
|
||
});
|