@@ -23,8 +23,8 @@ describe('Outlook Create Event', function test() {
23
23
it ( 'should emit (data and end events on success create request - case: http 200' , done => {
24
24
const scope1 = nock ( refreshTokenUri ) . post ( refreshTokenApi )
25
25
. reply ( 200 , {
26
- access_token : 1
27
- } ) ;
26
+ access_token : 1
27
+ } ) ;
28
28
29
29
const scope2 = nock ( microsoftGraphUri ) . post ( microsoftGraphApi )
30
30
. reply ( 200 , jsonOut ) ;
@@ -36,6 +36,19 @@ describe('Outlook Create Event', function test() {
36
36
expect ( calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( 'end' ) ;
37
37
expect ( calls . argsFor ( 0 ) [ 1 ] . body ) . toEqual ( {
38
38
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
+ } ,
39
52
calendarId : 'AAMkAGYyNmJlYjBmLTgwOWYtNGU0Mi04NW'
40
53
} ) ;
41
54
expect ( scope1 . isDone ( ) ) . toBeTruthy ( ) ;
@@ -53,8 +66,8 @@ describe('Outlook Create Event', function test() {
53
66
it ( 'should emit (data and end events on success create request - case: http 201' , done => {
54
67
const scope1 = nock ( refreshTokenUri ) . post ( refreshTokenApi )
55
68
. reply ( 200 , {
56
- access_token : 1
57
- } ) ;
69
+ access_token : 1
70
+ } ) ;
58
71
59
72
const scope2 = nock ( microsoftGraphUri ) . post ( microsoftGraphApi )
60
73
. reply ( 201 , jsonOut ) ;
@@ -66,6 +79,19 @@ describe('Outlook Create Event', function test() {
66
79
expect ( calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( 'end' ) ;
67
80
expect ( calls . argsFor ( 0 ) [ 1 ] . body ) . toEqual ( {
68
81
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
+ } ,
69
95
calendarId : 'AAMkAGYyNmJlYjBmLTgwOWYtNGU0Mi04NW'
70
96
} ) ;
71
97
expect ( scope1 . isDone ( ) ) . toBeTruthy ( ) ;
@@ -83,7 +109,7 @@ describe('Outlook Create Event', function test() {
83
109
it ( 'should emit error and end events on unsuccessful refresh token request' , done => {
84
110
const scope1 = nock ( refreshTokenUri ) . post ( refreshTokenApi )
85
111
. reply ( 401 , {
86
- access_token : 1
112
+ access_token : 1
87
113
} ) ;
88
114
89
115
function checkResults ( ) {
@@ -106,8 +132,8 @@ describe('Outlook Create Event', function test() {
106
132
it ( 'should emit error and end events on unsuccessful create request - case: bad request' , done => {
107
133
const scope1 = nock ( refreshTokenUri ) . post ( refreshTokenApi )
108
134
. reply ( 200 , {
109
- access_token : 1
110
- } ) ;
135
+ access_token : 1
136
+ } ) ;
111
137
112
138
const scope2 = nock ( microsoftGraphUri ) . post ( microsoftGraphApi )
113
139
. reply ( 400 , jsonOut ) ;
@@ -132,8 +158,8 @@ describe('Outlook Create Event', function test() {
132
158
it ( 'should emit error and end events on unsuccessful create request - case: consent problems' , done => {
133
159
const scope1 = nock ( refreshTokenUri ) . post ( refreshTokenApi )
134
160
. reply ( 200 , {
135
- access_token : 1
136
- } ) ;
161
+ access_token : 1
162
+ } ) ;
137
163
138
164
const scope2 = nock ( microsoftGraphUri ) . post ( microsoftGraphApi )
139
165
. reply ( 403 , jsonOut ) ;
0 commit comments