|
|
@ -1,9 +1,9 @@ |
|
|
|
import { createSamplePackagesRepository } from './samplePackagesRepository'; |
|
|
|
import { createSamplePackagesRepository } from './samplePackagesRepository'; |
|
|
|
|
|
|
|
|
|
|
|
describe('createSamplePackagesRepository', () => { |
|
|
|
describe('createSamplePackagesRepository', () => { |
|
|
|
it('returns correct info for FedEx/TN12345681', async () => { |
|
|
|
it('returns correct info for FedEx/TN12345683', async () => { |
|
|
|
const client = await createSamplePackagesRepository(); |
|
|
|
const client = await createSamplePackagesRepository(); |
|
|
|
const result = await client.getPackage('FedEx', 'TN12345681'); |
|
|
|
const result = await client.getPackage('FedEx', 'TN12345683'); |
|
|
|
expect(result).toEqual({ |
|
|
|
expect(result).toEqual({ |
|
|
|
found: true, |
|
|
|
found: true, |
|
|
|
value: { |
|
|
|
value: { |
|
|
@ -15,13 +15,13 @@ describe('createSamplePackagesRepository', () => { |
|
|
|
receiverAddress: 'Street 9, 1016 Amsterdam, Netherlands', |
|
|
|
receiverAddress: 'Street 9, 1016 Amsterdam, Netherlands', |
|
|
|
senderAddress: 'Street 4, 50667 Cologne, Germany', |
|
|
|
senderAddress: 'Street 4, 50667 Cologne, Germany', |
|
|
|
status: 'transit', |
|
|
|
status: 'transit', |
|
|
|
trackingNumber: 'TN12345681', |
|
|
|
trackingNumber: 'TN12345683', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
it('does not return info for DHL/TN12345681', async () => { |
|
|
|
it('does not return info for DHL/TN12345683', async () => { |
|
|
|
const client = await createSamplePackagesRepository(); |
|
|
|
const client = await createSamplePackagesRepository(); |
|
|
|
const result = await client.getPackage('DHL', 'TN12345681'); |
|
|
|
const result = await client.getPackage('DHL', 'TN12345683'); |
|
|
|
expect(result).toEqual({ |
|
|
|
expect(result).toEqual({ |
|
|
|
found: false, |
|
|
|
found: false, |
|
|
|
}); |
|
|
|
}); |
|
|
|