Skip to content

Commit 88866b5

Browse files
author
Igor Drobiazko
committed
Fixed test
1 parent afa775a commit 88866b5

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

spec/actions/createEvent.spec.js

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ describe('Outlook Create Event', function test() {
2323
it('should emit (data and end events on success create request - case: http 200', done => {
2424
const scope1 = nock(refreshTokenUri).post(refreshTokenApi)
2525
.reply(200, {
26-
access_token: 1
27-
});
26+
access_token: 1
27+
});
2828

2929
const scope2 = nock(microsoftGraphUri).post(microsoftGraphApi)
3030
.reply(200, jsonOut);
@@ -36,6 +36,19 @@ describe('Outlook Create Event', function test() {
3636
expect(calls.argsFor(1)[0]).toEqual('end');
3737
expect(calls.argsFor(0)[1].body).toEqual({
3838
id: 'testid12345',
39+
subject: 'Unit Test - Simple Event',
40+
body: {
41+
contentType: 'HTML',
42+
content: 'This is a test.'
43+
},
44+
start: {
45+
dateTime: '2017-05-19T18:00:00',
46+
timeZone: 'Central European Standard Time'
47+
},
48+
end: {
49+
dateTime: '2017-05-20T19:00:00',
50+
timeZone: 'Central European Standard Time'
51+
},
3952
calendarId: 'AAMkAGYyNmJlYjBmLTgwOWYtNGU0Mi04NW'
4053
});
4154
expect(scope1.isDone()).toBeTruthy();
@@ -53,8 +66,8 @@ describe('Outlook Create Event', function test() {
5366
it('should emit (data and end events on success create request - case: http 201', done => {
5467
const scope1 = nock(refreshTokenUri).post(refreshTokenApi)
5568
.reply(200, {
56-
access_token: 1
57-
});
69+
access_token: 1
70+
});
5871

5972
const scope2 = nock(microsoftGraphUri).post(microsoftGraphApi)
6073
.reply(201, jsonOut);
@@ -66,6 +79,19 @@ describe('Outlook Create Event', function test() {
6679
expect(calls.argsFor(1)[0]).toEqual('end');
6780
expect(calls.argsFor(0)[1].body).toEqual({
6881
id: 'testid12345',
82+
subject: 'Unit Test - Simple Event',
83+
body: {
84+
contentType: 'HTML',
85+
content: 'This is a test.'
86+
},
87+
start: {
88+
dateTime: '2017-05-19T18:00:00',
89+
timeZone: 'Central European Standard Time'
90+
},
91+
end: {
92+
dateTime: '2017-05-20T19:00:00',
93+
timeZone: 'Central European Standard Time'
94+
},
6995
calendarId: 'AAMkAGYyNmJlYjBmLTgwOWYtNGU0Mi04NW'
7096
});
7197
expect(scope1.isDone()).toBeTruthy();
@@ -83,7 +109,7 @@ describe('Outlook Create Event', function test() {
83109
it('should emit error and end events on unsuccessful refresh token request', done => {
84110
const scope1 = nock(refreshTokenUri).post(refreshTokenApi)
85111
.reply(401, {
86-
access_token: 1
112+
access_token: 1
87113
});
88114

89115
function checkResults() {
@@ -106,8 +132,8 @@ describe('Outlook Create Event', function test() {
106132
it('should emit error and end events on unsuccessful create request - case: bad request', done => {
107133
const scope1 = nock(refreshTokenUri).post(refreshTokenApi)
108134
.reply(200, {
109-
access_token: 1
110-
});
135+
access_token: 1
136+
});
111137

112138
const scope2 = nock(microsoftGraphUri).post(microsoftGraphApi)
113139
.reply(400, jsonOut);
@@ -132,8 +158,8 @@ describe('Outlook Create Event', function test() {
132158
it('should emit error and end events on unsuccessful create request - case: consent problems', done => {
133159
const scope1 = nock(refreshTokenUri).post(refreshTokenApi)
134160
.reply(200, {
135-
access_token: 1
136-
});
161+
access_token: 1
162+
});
137163

138164
const scope2 = nock(microsoftGraphUri).post(microsoftGraphApi)
139165
.reply(403, jsonOut);

0 commit comments

Comments
 (0)