Files
explore/ui/tx/assetFlows/utils/generateFlowViewData.spec.ts
tom goriunovandGitHub 5d337fc555 Migrate from Jest to Vitest (#3173)
* first part of transition

* second part of transition

* remove jest

* bump up node version and playwright version

* update all screenshots because of the new playwright version

* fix tests

* one more screenshot update
2025-12-10 19:21:07 +01:00

50 lines
1.2 KiB
TypeScript

import * as transactionMock from 'mocks/noves/transaction';
import { it, expect } from 'vitest';
import { generateFlowViewData } from './generateFlowViewData';
it('creates asset flows items', async() => {
const result = generateFlowViewData(transactionMock.transaction);
expect(result).toEqual(
[
{
action: {
label: 'Sent',
amount: '3000',
flowDirection: 'toRight',
token: {
address: '0x1bfe4298796198f8664b18a98640cec7c89b5baa',
decimals: 18,
name: 'PQR-Test',
symbol: 'PQR',
},
},
rightActor: {
address: '0xdD15D2650387Fb6FEDE27ae7392C402a393F8A37',
name: null,
},
accountAddress: '0xef6595a423c99f3f2821190a4d96fce4dcd89a80',
},
{
action: {
label: 'Paid Gas',
amount: '0.000395521502109448',
flowDirection: 'toRight',
token: {
address: 'ETH',
decimals: 18,
name: 'ETH',
symbol: 'ETH',
},
},
rightActor: {
address: '',
name: 'Validators',
},
accountAddress: '0xef6595a423c99f3f2821190a4d96fce4dcd89a80',
},
],
);
});