@@ -107,10 +107,10 @@ test('ios config with all required values', async () => {
107
107
ios : {
108
108
109
109
ascAppId : '1223423523' ,
110
- appleTeamId : 'QWERTY ' ,
110
+ appleTeamId : 'AB32CZE81F ' ,
111
111
ascApiKeyPath : './path-ABCD.p8' ,
112
- ascApiKeyIssuerId : 'abc-123-def-456 ' ,
113
- ascApiKeyId : 'ABCD ' ,
112
+ ascApiKeyIssuerId : 'b4d78f58-48c6-4f2c-96cb-94d8cd76970a ' ,
113
+ ascApiKeyId : 'AB32CZE81F ' ,
114
114
} ,
115
115
} ,
116
116
} ,
@@ -121,11 +121,11 @@ test('ios config with all required values', async () => {
121
121
122
122
expect ( iosProfile ) . toEqual ( {
123
123
124
- appleTeamId : 'QWERTY ' ,
124
+ appleTeamId : 'AB32CZE81F ' ,
125
125
ascAppId : '1223423523' ,
126
126
ascApiKeyPath : './path-ABCD.p8' ,
127
- ascApiKeyIssuerId : 'abc-123-def-456 ' ,
128
- ascApiKeyId : 'ABCD ' ,
127
+ ascApiKeyIssuerId : 'b4d78f58-48c6-4f2c-96cb-94d8cd76970a ' ,
128
+ ascApiKeyId : 'AB32CZE81F ' ,
129
129
language : 'en-US' ,
130
130
} ) ;
131
131
} ) ;
@@ -137,7 +137,7 @@ test('ios config with ascApiKey fields set to env var', async () => {
137
137
ios : {
138
138
139
139
ascAppId : '1223423523' ,
140
- appleTeamId : 'QWERTY ' ,
140
+ appleTeamId : 'AB32CZE81F ' ,
141
141
ascApiKeyPath : '$ASC_API_KEY_PATH' ,
142
142
ascApiKeyIssuerId : '$ASC_API_KEY_ISSUER_ID' ,
143
143
ascApiKeyId : '$ASC_API_KEY_ID' ,
@@ -148,18 +148,18 @@ test('ios config with ascApiKey fields set to env var', async () => {
148
148
149
149
try {
150
150
process . env . ASC_API_KEY_PATH = './path-ABCD.p8' ;
151
- process . env . ASC_API_KEY_ISSUER_ID = 'abc-123-def-456 ' ;
152
- process . env . ASC_API_KEY_ID = 'ABCD ' ;
151
+ process . env . ASC_API_KEY_ISSUER_ID = 'b4d78f58-48c6-4f2c-96cb-94d8cd76970a ' ;
152
+ process . env . ASC_API_KEY_ID = 'AB32CZE81F ' ;
153
153
const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
154
154
const iosProfile = await EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
155
155
156
156
expect ( iosProfile ) . toEqual ( {
157
157
158
158
ascAppId : '1223423523' ,
159
- appleTeamId : 'QWERTY ' ,
159
+ appleTeamId : 'AB32CZE81F ' ,
160
160
ascApiKeyPath : './path-ABCD.p8' ,
161
- ascApiKeyIssuerId : 'abc-123-def-456 ' ,
162
- ascApiKeyId : 'ABCD ' ,
161
+ ascApiKeyIssuerId : 'b4d78f58-48c6-4f2c-96cb-94d8cd76970a ' ,
162
+ ascApiKeyId : 'AB32CZE81F ' ,
163
163
language : 'en-US' ,
164
164
} ) ;
165
165
} finally {
@@ -176,16 +176,16 @@ test('valid profile extending other profile', async () => {
176
176
ios : {
177
177
178
178
ascAppId : '1223423523' ,
179
- appleTeamId : 'QWERTY ' ,
179
+ appleTeamId : 'AB32CZE81F ' ,
180
180
} ,
181
181
} ,
182
182
extension : {
183
183
extends : 'base' ,
184
184
ios : {
185
- appleTeamId : 'ABCDEF ' ,
185
+ appleTeamId : 'AB32CZE81F ' ,
186
186
ascApiKeyPath : './path-ABCD.p8' ,
187
- ascApiKeyIssuerId : 'abc-123-def-456 ' ,
188
- ascApiKeyId : 'ABCD ' ,
187
+ ascApiKeyIssuerId : '2af70a7a-2ac5-44d4-924e-ae97a7ca9333 ' ,
188
+ ascApiKeyId : 'AB32CZE81F ' ,
189
189
} ,
190
190
} ,
191
191
} ,
@@ -202,19 +202,134 @@ test('valid profile extending other profile', async () => {
202
202
language : 'en-US' ,
203
203
204
204
ascAppId : '1223423523' ,
205
- appleTeamId : 'QWERTY ' ,
205
+ appleTeamId : 'AB32CZE81F ' ,
206
206
} ) ;
207
207
expect ( extendedProfile ) . toEqual ( {
208
208
language : 'en-US' ,
209
209
210
210
ascAppId : '1223423523' ,
211
- appleTeamId : 'ABCDEF ' ,
211
+ appleTeamId : 'AB32CZE81F ' ,
212
212
ascApiKeyPath : './path-ABCD.p8' ,
213
- ascApiKeyIssuerId : 'abc-123-def-456 ' ,
214
- ascApiKeyId : 'ABCD ' ,
213
+ ascApiKeyIssuerId : '2af70a7a-2ac5-44d4-924e-ae97a7ca9333 ' ,
214
+ ascApiKeyId : 'AB32CZE81F ' ,
215
215
} ) ;
216
216
} ) ;
217
217
218
+ test ( 'ios config with with invalid appleId' , async ( ) => {
219
+ await fs . writeJson ( '/project/eas.json' , {
220
+ submit : {
221
+ release : {
222
+ ios : {
223
+ appleId : '| /bin/bash echo "hello"' ,
224
+ ascAppId : '1223423523' ,
225
+ appleTeamId : 'AB32CZE81F' ,
226
+ ascApiKeyPath : './path-ABCD.p8' ,
227
+ ascApiKeyIssuerId : '2af70a7a-2ac5-44d4-924e-ae97a7ca9333' ,
228
+ ascApiKeyId : 'AB32CZE81F' ,
229
+ } ,
230
+ } ,
231
+ } ,
232
+ } ) ;
233
+
234
+ const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
235
+ const promise = EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
236
+ await expect ( promise ) . rejects . toThrow (
237
+ 'Invalid Apple ID was specified. It should be a valid email address. Example: "[email protected] ".'
238
+ ) ;
239
+ } ) ;
240
+
241
+ test ( 'ios config with with invalid ascAppId' , async ( ) => {
242
+ await fs . writeJson ( '/project/eas.json' , {
243
+ submit : {
244
+ release : {
245
+ ios : {
246
+
247
+ ascAppId : 'othervalue' ,
248
+ appleTeamId : 'AB32CZE81F' ,
249
+ ascApiKeyPath : './path-ABCD.p8' ,
250
+ ascApiKeyIssuerId : '2af70a7a-2ac5-44d4-924e-ae97a7ca9333' ,
251
+ ascApiKeyId : 'AB32CZE81F' ,
252
+ } ,
253
+ } ,
254
+ } ,
255
+ } ) ;
256
+
257
+ const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
258
+ const promise = EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
259
+ await expect ( promise ) . rejects . toThrow (
260
+ 'Invalid Apple App Store Connect App ID ("ascAppId") was specified. It should consist only of digits. Example: "1234567891". Learn more: https://expo.fyi/asc-app-id.'
261
+ ) ;
262
+ } ) ;
263
+
264
+ test ( 'ios config with with invalid appleTeamId' , async ( ) => {
265
+ await fs . writeJson ( '/project/eas.json' , {
266
+ submit : {
267
+ release : {
268
+ ios : {
269
+
270
+ ascAppId : '1223423523' ,
271
+ appleTeamId : 'ls -la' ,
272
+ ascApiKeyPath : './path-ABCD.p8' ,
273
+ ascApiKeyIssuerId : '2af70a7a-2ac5-44d4-924e-ae97a7ca9333' ,
274
+ ascApiKeyId : 'AB32CZE81F' ,
275
+ } ,
276
+ } ,
277
+ } ,
278
+ } ) ;
279
+
280
+ const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
281
+ const promise = EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
282
+ await expect ( promise ) . rejects . toThrow (
283
+ 'Invalid Apple Team ID was specified. It should consist of 10 uppercase letters or digits. Example: "AB32CZE81F".'
284
+ ) ;
285
+ } ) ;
286
+
287
+ test ( 'ios config with with invalid ascApiKeyIssuerId' , async ( ) => {
288
+ await fs . writeJson ( '/project/eas.json' , {
289
+ submit : {
290
+ release : {
291
+ ios : {
292
+
293
+ ascAppId : '1223423523' ,
294
+ appleTeamId : 'AB32CZE81F' ,
295
+ ascApiKeyPath : './path-ABCD.p8' ,
296
+ ascApiKeyIssuerId : 'notanuuid' ,
297
+ ascApiKeyId : 'AB32CZE81F' ,
298
+ } ,
299
+ } ,
300
+ } ,
301
+ } ) ;
302
+
303
+ const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
304
+ const promise = EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
305
+ await expect ( promise ) . rejects . toThrow (
306
+ 'Invalid Apple App Store Connect API Key Issuer ID ("ascApiKeyIssuerId") was specified. It should be a valid UUID. Example: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". Learn more: https://expo.fyi/creating-asc-api-key.'
307
+ ) ;
308
+ } ) ;
309
+
310
+ test ( 'ios config with with invalid ascApiKeyId' , async ( ) => {
311
+ await fs . writeJson ( '/project/eas.json' , {
312
+ submit : {
313
+ release : {
314
+ ios : {
315
+
316
+ ascAppId : '1223423523' ,
317
+ appleTeamId : 'AB32CZE81F' ,
318
+ ascApiKeyPath : './path-ABCD.p8' ,
319
+ ascApiKeyIssuerId : 'b4d78f58-48c6-4f2c-96cb-94d8cd76970a' ,
320
+ ascApiKeyId : 'wrong value' ,
321
+ } ,
322
+ } ,
323
+ } ,
324
+ } ) ;
325
+
326
+ const accessor = EasJsonAccessor . fromProjectPath ( '/project' ) ;
327
+ const promise = EasJsonUtils . getSubmitProfileAsync ( accessor , Platform . IOS , 'release' ) ;
328
+ await expect ( promise ) . rejects . toThrow (
329
+ `Invalid Apple App Store Connect API Key ID ("ascApiKeyId") was specified. It should consist of uppercase letters or digits. Example: "AB32CZE81F". Learn more: https://expo.fyi/creating-asc-api-key.`
330
+ ) ;
331
+ } ) ;
332
+
218
333
test ( 'get profile names' , async ( ) => {
219
334
await fs . writeJson ( '/project/eas.json' , {
220
335
submit : {
0 commit comments