Tests WIP

This commit is contained in:
Lucas Bustamante 2022-01-18 19:36:18 -03:00
parent 46af82a842
commit 2120c08eb0
1 changed files with 15 additions and 1 deletions

View File

@ -55,7 +55,13 @@ const jsonPayloadFull = JSON.stringify({
date_paid: 'Foo Date Paid',
cart_hash: 'Foo Cart Hash',
number: '1218',
meta_data: [],
meta_data: [
{
id: 123,
key: "Foo Metadata Key 1",
value: "Foo Metadata Value 1"
}
],
line_items: [
{
id: 6137,
@ -265,6 +271,14 @@ describe( 'OrderTransformer', () => {
//expect(shipping.phone).toStrictEqual('Shipping Phone');
expect( createShippingAddressTransformer().fromModel(shipping) ).toStrictEqual(JSON.parse(jsonPayloadFull).shipping);
// Metadata
//expect(order.metaData).toHaveLength(1);
//expect(order.metaData[0]['id']).toStrictEqual(123);
//expect(order.metaData[0]['key']).toStrictEqual('Foo Metadata Key 1');
//expect(order.metaData[0]['value']).toStrictEqual('Foo Metadata Value 1');
// Line Items
console.log(order.lineItems);
expect(order.lineItems).toHaveLength(1);
} );
} );