You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import DistanceRequestUtils from '@libs/DistanceRequestUtils';
import type {Unit} from '@src/types/onyx/Policy';
describe('DistanceRequestUtils', () => {
describe('getDistanceRequestAmount', () => {
test.each([
[350, 8605.146, 'mi', 65.5],
[561, 8605.146, 'km', 65.1],
] as const)('Correctly calculates amount %s for %s%s at a rate of %s per unit', (expectedResult: number, distance: number, unit: Unit, rate: number) => {
expect(DistanceRequestUtils.getDistanceRequestAmount(distance, unit, rate)).toBe(expectedResult);