-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocation.spec.ts
More file actions
34 lines (29 loc) · 918 Bytes
/
location.spec.ts
File metadata and controls
34 lines (29 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import client from './lib/client'
import { env } from './lib/client';
import Sendstack, { Local, LocationResponse } from "../src/Sendstack";
const locals: Local[] = [
{ name: 'Agbara', locationCode: 'UMTV' },
{ name: 'Agege', locationCode: 'T58X' },
{ name: 'Ajah', locationCode: 'I0BT' },
]
const LocalParams: LocationResponse[] = [{state: 'Lagos', locals }]
const location: Sendstack['locations'] = env.live
? client.locations
: jest.fn(async () => {
return {
status: true,
message: '',
data: LocalParams
}
})
describe('Locations', () => {
it('should return locations', async () => {
const res = await location()
expect(res).toMatchObject({
status: true,
message: '',
data: expect.arrayContaining<LocationResponse[]>([expect.any(Object)]),
})
}
)
})