Files
twenty_crm/packages/twenty-front/src/utils/__tests__/convert-currency-amount.test.ts
Aryan Singh 5c8fe027f9 5425 - Introducing support for all Composite Fields Import (#5470)
Adding support for all Composite Fields while using the "import"
functionality. This includes:
- Currency
- Address

Edit : 
- Refactored a lot of types in the spreadsheet import module
- Renamed a lot of functions, hooks and types that were not
self-explanatory enough

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-23 18:02:23 +02:00

18 lines
602 B
TypeScript

import {
convertCurrencyAmountToCurrencyMicros,
convertCurrencyMicrosToCurrencyAmount,
} from '~/utils/convertCurrencyToCurrencyMicros';
describe('convertCurrencyAmountToCurrencyMicros', () => {
it('should convert currencyAmount to micros', () => {
expect(convertCurrencyAmountToCurrencyMicros(1)).toBe(1000000);
expect(convertCurrencyAmountToCurrencyMicros(1.5)).toBe(1500000);
});
});
describe('convertCurrencyMicrosToCurrencyAmount', () => {
it('should convert currency micros to currency', () => {
expect(convertCurrencyMicrosToCurrencyAmount(24000000)).toBe(24);
});
});