Files
zarinpal-analytics-frontend/src/lib/components/TransactionStatusChart.test.ts

23 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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();
});
});