Skip to content

Instantly share code, notes, and snippets.

@lgandecki
Created June 21, 2019 09:07
Show Gist options
  • Save lgandecki/5628b6f15ddc4047fabc3fcb459a7d4b to your computer and use it in GitHub Desktop.
Save lgandecki/5628b6f15ddc4047fabc3fcb459a7d4b to your computer and use it in GitHub Desktop.
it("should be calculated with estimateShipping based on the price and weight", async () => {
const PRICE = 999;
const WEIGHT = 100;
const mocks = { Product: () => ({ price: PRICE, weight: WEIGHT }) };
td.when(estimateShipping({ price: PRICE, weight: WEIGHT })).thenReturn(99);
const result = await executeGraphql({
query,
service,
mocks
});
expect(result.data._getProduct.shippingEstimate).toEqual(99);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment