@@ -14,6 +14,8 @@ const regex = new RegExp(
14
14
describe ( "setSmtpCredentials function" , ( ) => {
15
15
test ( "return smtpServerDomain credentials with new password" , ( ) => {
16
16
const config : Config = {
17
+ database : "fake-database" ,
18
+ databaseRegion : "us-central1" ,
17
19
smtpConnectionUri :
18
20
19
21
smtpPassword : "fakepassword" ,
@@ -35,6 +37,8 @@ describe("setSmtpCredentials function", () => {
35
37
36
38
test ( "return smtpServerDomain credentials with old password" , ( ) => {
37
39
const config : Config = {
40
+ database : "fake-database" ,
41
+ databaseRegion : "us-central1" ,
38
42
smtpConnectionUri :
39
43
40
44
location : "" ,
@@ -56,6 +60,8 @@ describe("setSmtpCredentials function", () => {
56
60
57
61
test ( "return smtpConnectionUri credentials without any password" , ( ) => {
58
62
const config : Config = {
63
+ database : "fake-database" ,
64
+ databaseRegion : "us-central1" ,
59
65
smtpConnectionUri :
"smtps://[email protected] @smtp.gmail.com:465" ,
60
66
location : "" ,
61
67
mailCollection : "" ,
@@ -76,6 +82,8 @@ describe("setSmtpCredentials function", () => {
76
82
77
83
test ( "return smtpConnectionUri credentials without any password and username" , ( ) => {
78
84
const config : Config = {
85
+ database : "fake-database" ,
86
+ databaseRegion : "us-central1" ,
79
87
smtpConnectionUri : "smtp://smtp.gmail.com:465" ,
80
88
location : "" ,
81
89
mailCollection : "" ,
@@ -95,6 +103,8 @@ describe("setSmtpCredentials function", () => {
95
103
96
104
test ( "return smtpConnectionUri credentials with query params" , ( ) => {
97
105
const config : Config = {
106
+ database : "fake-database" ,
107
+ databaseRegion : "us-central1" ,
98
108
smtpConnectionUri :
99
109
"smtp://[email protected] :[email protected] :465?pool=true&service=gmail" ,
100
110
location : "" ,
@@ -118,6 +128,8 @@ describe("setSmtpCredentials function", () => {
118
128
119
129
test ( "return valid smtpConnectionUri credentials with valid special chars in password" , ( ) => {
120
130
const config : Config = {
131
+ database : "fake-database" ,
132
+ databaseRegion : "us-central1" ,
121
133
smtpConnectionUri :
122
134
"smtp://[email protected] @smtp.gmail.com:465?pool=true&service=gmail" ,
123
135
smtpPassword : "4,h?dhuNTbv9zMrP4&7&7%*3" ,
@@ -142,6 +154,8 @@ describe("setSmtpCredentials function", () => {
142
154
143
155
test ( "return valid smtpConnectionUri credentials with valid special chars in connectionUri password" , ( ) => {
144
156
const config : Config = {
157
+ database : "fake-database" ,
158
+ databaseRegion : "us-central1" ,
145
159
smtpConnectionUri :
146
160
"smtp://[email protected] :4,hdhuNTbv9zMrP4&7&7%*[email protected] :465?pool=true&service=gmail" ,
147
161
location : "" ,
@@ -166,6 +180,8 @@ describe("setSmtpCredentials function", () => {
166
180
167
181
test ( "throw error for invalid smtpConnectionUri" , ( ) => {
168
182
const config : Config = {
183
+ database : "fake-database" ,
184
+ databaseRegion : "us-central1" ,
169
185
smtpConnectionUri :
170
186
"smtp://[email protected] :4,h?dhuNTbv9zMrP4&7&7%*[email protected] :465?pool=true&service=gmail" ,
171
187
location : "" ,
@@ -184,6 +200,8 @@ describe("setSmtpCredentials function", () => {
184
200
describe ( "isSendGrid function" , ( ) => {
185
201
test ( "return true for SendGrid SMTP URI" , ( ) => {
186
202
const config : Config = {
203
+ database : "fake-database" ,
204
+ databaseRegion : "us-central1" ,
187
205
smtpConnectionUri :
"smtps://[email protected] :465" ,
188
206
location : "" ,
189
207
mailCollection : "" ,
@@ -196,6 +214,8 @@ describe("isSendGrid function", () => {
196
214
197
215
test ( "return false for non-SendGrid SMTP URI" , ( ) => {
198
216
const config : Config = {
217
+ database : "fake-database" ,
218
+ databaseRegion : "us-central1" ,
199
219
smtpConnectionUri :
200
220
201
221
location : "" ,
@@ -210,6 +230,8 @@ describe("isSendGrid function", () => {
210
230
211
231
test ( "return invalid smtpConnectionUri credentials with invalid separator" , ( ) => {
212
232
const config : Config = {
233
+ database : "fake-database" ,
234
+ databaseRegion : "us-central1" ,
213
235
smtpConnectionUri :
214
236
"smtp://[email protected] :4,h?dhuNTbv9zMrP4&7&7%*3:smtp.gmail.com:465?pool=true&service=gmail" ,
215
237
location : "" ,
@@ -224,6 +246,8 @@ test("return invalid smtpConnectionUri credentials with invalid separator", () =
224
246
225
247
test ( "correctly detects SendGrid SMTP URI" , ( ) => {
226
248
const config : Config = {
249
+ database : "fake-database" ,
250
+ databaseRegion : "us-central1" ,
227
251
smtpConnectionUri :
"smtps://[email protected] :465" ,
228
252
location : "" ,
229
253
mailCollection : "" ,
@@ -234,6 +258,8 @@ test("correctly detects SendGrid SMTP URI", () => {
234
258
expect ( isSendGrid ( config ) ) . toBe ( true ) ;
235
259
236
260
const invalidConfig : Config = {
261
+ database : "fake-database" ,
262
+ databaseRegion : "us-central1" ,
237
263
smtpConnectionUri :
"smtps://[email protected] :465" ,
238
264
location : "" ,
239
265
mailCollection : "" ,
@@ -246,6 +272,8 @@ test("correctly detects SendGrid SMTP URI", () => {
246
272
247
273
test ( "correctly uses oAuth credentials when provided" , ( ) => {
248
274
const config : Config = {
275
+ database : "fake-database" ,
276
+ databaseRegion : "us-central1" ,
249
277
smtpConnectionUri :
250
278
251
279
location : "" ,
0 commit comments