mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
21 lines
822 B
TypeScript
21 lines
822 B
TypeScript
import { ShippingAddressDTO } from '@generated/swagger/crm-api';
|
|
import { ShippingAddressHelper } from './shipping-address.helper';
|
|
|
|
describe('ShippingAddressHelper', () => {
|
|
describe('getDefaultShippingAddress', () => {
|
|
it('should return undefined if function gets called with invalid arguments', () => {
|
|
const shippingAdress = undefined;
|
|
expect(ShippingAddressHelper.getDefaultShippingAddress(shippingAdress)).toEqual(undefined);
|
|
});
|
|
|
|
it('should return the latest default shippingAdress', () => {
|
|
const shippingAdress: ShippingAddressDTO[] = [
|
|
{ isDefault: new Date().toJSON() },
|
|
{ isDefault: new Date(2020, 5, 15).toJSON() },
|
|
{},
|
|
];
|
|
expect(ShippingAddressHelper.getDefaultShippingAddress(shippingAdress)).toEqual(shippingAdress[0]);
|
|
});
|
|
});
|
|
});
|