Skip to content

Commit

Permalink
Fix version on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Mar 10, 2020
1 parent 42110b3 commit 5dc8062
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('ServiceNow lib', () => {
const res = await serviceNow.getUserID();
const [url, { method }] = axiosMock.mock.calls[0];

expect(url).toEqual(prependInstanceUrl('api/now/v1/table/sys_user?user_name=username'));
expect(url).toEqual(prependInstanceUrl('api/now/v2/table/sys_user?user_name=username'));
expect(method).toEqual('get');
expect(res).toEqual('123');
});
Expand All @@ -80,7 +80,7 @@ describe('ServiceNow lib', () => {
});
const [url, { method, data }] = axiosMock.mock.calls[0];

expect(url).toEqual(prependInstanceUrl('api/now/v1/table/incident'));
expect(url).toEqual(prependInstanceUrl('api/now/v2/table/incident'));
expect(method).toEqual('post');
expect(data).toEqual({
short_description: 'A title',
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('ServiceNow lib', () => {
});
const [url, { method, data }] = axiosMock.mock.calls[0];

expect(url).toEqual(prependInstanceUrl(`api/now/v1/table/incident/123`));
expect(url).toEqual(prependInstanceUrl(`api/now/v2/table/incident/123`));
expect(method).toEqual('patch');
expect(data).toEqual({ short_description: params.title });
expect(res).toEqual({
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('ServiceNow lib', () => {

const [url, { method, data }] = axiosMock.mock.calls[0];

expect(url).toEqual(prependInstanceUrl(`api/now/v1/table/incident/123`));
expect(url).toEqual(prependInstanceUrl(`api/now/v2/table/incident/123`));
expect(method).toEqual('patch');
expect(data).toEqual({
comments: 'A comment',
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('ServiceNow lib', () => {

comments.forEach((comment, index) => {
const [url, { method, data }] = axiosMock.mock.calls[index];
expect(url).toEqual(prependInstanceUrl('api/now/v1/table/incident/000'));
expect(url).toEqual(prependInstanceUrl('api/now/v2/table/incident/000'));
expect(method).toEqual('patch');
expect(data).toEqual({
comments: comment.comment,
Expand Down

0 comments on commit 5dc8062

Please sign in to comment.