Skip to content

Commit 41542cc

Browse files
author
Olle Johannesson
committed
Add missing tests for amadeus/client.delete
1 parent 303e5e6 commit 41542cc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/amadeus/client.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,26 @@ describe('Client', () => {
123123
});
124124
});
125125

126+
describe('.delete', () => {
127+
it('should create a new request and call it', () => {
128+
let call = client.unauthenticatedRequest = jest.fn();
129+
client.accessToken = { bearerToken: () => {
130+
return { then: resolve => resolve('token') };
131+
}};
132+
client.delete(path, params);
133+
expect(call).toHaveBeenCalledWith('DELETE', path, params, 'token');
134+
});
135+
136+
it('should work without params', () => {
137+
let call = client.unauthenticatedRequest = jest.fn();
138+
client.accessToken = { bearerToken: () => {
139+
return { then: resolve => resolve('token') };
140+
}};
141+
client.delete(path);
142+
expect(call).toHaveBeenCalledWith('DELETE', path, {}, 'token');
143+
});
144+
});
145+
126146
describe('.unauthenticatedRequest', () => {
127147
it('should create a new request and call it', () => {
128148
client.accessToken.bearerToken = jest.fn(() => Promise.resolve('data'));

0 commit comments

Comments
 (0)