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>
18 lines
602 B
TypeScript
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);
|
|
});
|
|
});
|