Files
backend/src/integrations/tbank/tbank-account.policy.spec.ts
T
ksv741 4796d9d3f0
Backend security / security (push) Successful in 8s
Backend verify / verify (push) Successful in 11m9s
Conventional commits / commits (pull_request) Successful in 28s
Backend security / security (pull_request) Successful in 7s
Backend verify / verify (pull_request) Successful in 10m38s
fix: harden auth and investment synchronization
Resolve A01-A10 and C01-C07 from the backend audit.
Preserve auth failures, forced candle reconciliation and forecast freshness.
Validate MOEX responses and nested HTTP errors; remove unused legacy paths.

Verified: 209 unit tests, 262 SQLite e2e tests on Linux, OpenAPI and durability.
Record the remaining macOS native SQLite abort in the audit.
2026-09-27 14:09:05 +03:00

46 lines
1.2 KiB
TypeScript

import { supportedTbankAccounts } from './tbank-account.policy';
describe('tbank-account-policy', () => {
it('normalizes supported account types and fallback names', () => {
expect(
supportedTbankAccounts([
{
id: 'brokerage',
type: 'ACCOUNT_TYPE_TINKOFF',
name: ' Основной ',
openedDate: { seconds: '1723507200' },
},
{ id: 'debit', type: 'ACCOUNT_TYPE_DEBIT', name: 'Дебетовый' },
{ id: 'iis', type: 'ACCOUNT_TYPE_TINKOFF_IIS', name: ' ' },
{ id: 'box', type: 'ACCOUNT_TYPE_INVEST_BOX', name: ' ' },
{ id: 'fund', type: 'ACCOUNT_TYPE_INVEST_FUND', name: ' ' },
]),
).toEqual([
{
id: 'brokerage',
type: 'BROKERAGE',
name: 'Основной',
openedOn: '2024-08-13',
},
{
id: 'iis',
type: 'INDIVIDUAL_INVESTMENT',
name: 'ИИС',
openedOn: null,
},
{
id: 'box',
type: 'INVEST_BOX',
name: 'Инвесткопилка',
openedOn: null,
},
{
id: 'fund',
type: 'MONEY_MARKET_FUND',
name: 'Фонд денежного рынка',
openedOn: null,
},
]);
});
});