Skip to content

Commit 901cff5

Browse files
authored
test: Add test IDs (#9205)
1 parent 4b04c22 commit 901cff5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+302
-282
lines changed

spec/.eslintrc.json

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"expectAsync": true,
1717
"notEqual": true,
1818
"it_id": true,
19+
"fit_id": true,
1920
"it_only_db": true,
2021
"it_only_mongodb_version": true,
2122
"it_only_postgres_version": true,
@@ -27,6 +28,7 @@
2728
"fit_exclude_mongodb_version": true,
2829
"fit_exclude_node_version": true,
2930
"it_exclude_dbs": true,
31+
"fit_exclude_dbs": true,
3032
"describe_only_db": true,
3133
"fdescribe_only_db": true,
3234
"describe_only": true,

spec/AudienceRouter.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ describe('AudiencesRouter', () => {
317317
);
318318
});
319319

320-
it_exclude_dbs(['postgres'])('should support legacy parse.com audience fields', done => {
320+
it_id('af1111b5-3251-4b40-8f06-fb0fc624fa91')(it_exclude_dbs(['postgres'])('should support legacy parse.com audience fields', done => {
321321
const database = Config.get(Parse.applicationId).database.adapter.database;
322322
const now = new Date();
323323
Parse._request(
@@ -369,7 +369,7 @@ describe('AudiencesRouter', () => {
369369
});
370370
});
371371
});
372-
});
372+
}));
373373

374374
it('should be able to search on audiences', done => {
375375
Parse._request(

spec/AuthenticationAdapters.spec.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ describe('google auth adapter', () => {
645645
// }
646646
// });
647647

648-
it('(using client id as string) should verify id_token', async () => {
648+
it('(using client id as string) should verify id_token (google.com)', async () => {
649649
const fakeClaim = {
650650
iss: 'https://accounts.google.com',
651651
aud: 'secret',
@@ -663,7 +663,7 @@ describe('google auth adapter', () => {
663663
expect(result).toEqual(fakeClaim);
664664
});
665665

666-
it('(using client id as string) should throw error with with invalid jwt issuer', async () => {
666+
it('(using client id as string) should throw error with with invalid jwt issuer (google.com)', async () => {
667667
const fakeClaim = {
668668
iss: 'https://not.google.com',
669669
sub: 'the_user_id',
@@ -1466,7 +1466,7 @@ describe('apple signin auth adapter', () => {
14661466
}
14671467
});
14681468

1469-
it('should use algorithm from key header to verify id_token', async () => {
1469+
it('should use algorithm from key header to verify id_token (apple.com)', async () => {
14701470
const fakeClaim = {
14711471
iss: 'https://appleid.apple.com',
14721472
aud: 'secret',
@@ -1516,7 +1516,7 @@ describe('apple signin auth adapter', () => {
15161516
}
15171517
});
15181518

1519-
it('(using client id as string) should verify id_token', async () => {
1519+
it('(using client id as string) should verify id_token (apple.com)', async () => {
15201520
const fakeClaim = {
15211521
iss: 'https://appleid.apple.com',
15221522
aud: 'secret',
@@ -1536,7 +1536,7 @@ describe('apple signin auth adapter', () => {
15361536
expect(result).toEqual(fakeClaim);
15371537
});
15381538

1539-
it('(using client id as array) should verify id_token', async () => {
1539+
it('(using client id as array) should verify id_token (apple.com)', async () => {
15401540
const fakeClaim = {
15411541
iss: 'https://appleid.apple.com',
15421542
aud: 'secret',
@@ -1556,7 +1556,7 @@ describe('apple signin auth adapter', () => {
15561556
expect(result).toEqual(fakeClaim);
15571557
});
15581558

1559-
it('(using client id as array with multiple items) should verify id_token', async () => {
1559+
it('(using client id as array with multiple items) should verify id_token (apple.com)', async () => {
15601560
const fakeClaim = {
15611561
iss: 'https://appleid.apple.com',
15621562
aud: 'secret',
@@ -1576,7 +1576,7 @@ describe('apple signin auth adapter', () => {
15761576
expect(result).toEqual(fakeClaim);
15771577
});
15781578

1579-
it('(using client id as string) should throw error with with invalid jwt issuer', async () => {
1579+
it('(using client id as string) should throw error with with invalid jwt issuer (apple.com)', async () => {
15801580
const fakeClaim = {
15811581
iss: 'https://not.apple.com',
15821582
sub: 'the_user_id',
@@ -1629,7 +1629,7 @@ describe('apple signin auth adapter', () => {
16291629
}
16301630
});
16311631

1632-
it('(using client id as string) should throw error with with invalid jwt issuer with token', async () => {
1632+
it('(using client id as string) should throw error with with invalid jwt issuer with token (apple.com)', async () => {
16331633
const fakeClaim = {
16341634
iss: 'https://not.apple.com',
16351635
sub: 'the_user_id',
@@ -1698,7 +1698,7 @@ describe('apple signin auth adapter', () => {
16981698
}
16991699
});
17001700

1701-
it('should throw error with with invalid user id', async () => {
1701+
it('should throw error with with invalid user id (apple.com)', async () => {
17021702
const fakeClaim = {
17031703
iss: 'https://appleid.apple.com',
17041704
aud: 'invalid_client_id',
@@ -2022,7 +2022,7 @@ describe('facebook limited auth adapter', () => {
20222022
}
20232023
});
20242024

2025-
it('should use algorithm from key header to verify id_token', async () => {
2025+
it_id('7bfa55ab-8fd7-4526-992e-6de3df16bf9c', 'should use algorithm from key header to verify id_token (facebook.com)', async () => {
20262026
const fakeClaim = {
20272027
iss: 'https://www.facebook.com',
20282028
aud: 'secret',
@@ -2072,7 +2072,7 @@ describe('facebook limited auth adapter', () => {
20722072
}
20732073
});
20742074

2075-
it('(using client id as string) should verify id_token', async () => {
2075+
it_id('4bcb1a1a-11f8-4e12-a3f6-73f7e25e355a', '(using client id as string) should verify id_token (facebook.com)', async () => {
20762076
const fakeClaim = {
20772077
iss: 'https://www.facebook.com',
20782078
aud: 'secret',
@@ -2092,7 +2092,7 @@ describe('facebook limited auth adapter', () => {
20922092
expect(result).toEqual(fakeClaim);
20932093
});
20942094

2095-
it('(using client id as array) should verify id_token', async () => {
2095+
it_id('c521a272-2ac2-4d8b-b5ed-ea250336d8b1', '(using client id as array) should verify id_token (facebook.com)', async () => {
20962096
const fakeClaim = {
20972097
iss: 'https://www.facebook.com',
20982098
aud: 'secret',
@@ -2112,7 +2112,7 @@ describe('facebook limited auth adapter', () => {
21122112
expect(result).toEqual(fakeClaim);
21132113
});
21142114

2115-
it('(using client id as array with multiple items) should verify id_token', async () => {
2115+
it_id('e3f16404-18e9-4a87-a555-4710cfbdac67')('(using client id as array with multiple items) should verify id_token (facebook.com)', async () => {
21162116
const fakeClaim = {
21172117
iss: 'https://www.facebook.com',
21182118
aud: 'secret',
@@ -2132,7 +2132,7 @@ describe('facebook limited auth adapter', () => {
21322132
expect(result).toEqual(fakeClaim);
21332133
});
21342134

2135-
it('(using client id as string) should throw error with with invalid jwt issuer', async () => {
2135+
it_id('549c33a1-3a6b-4732-8cf6-8f010ad4569c')('(using client id as string) should throw error with with invalid jwt issuer (facebook.com)', async () => {
21362136
const fakeClaim = {
21372137
iss: 'https://not.facebook.com',
21382138
sub: 'the_user_id',
@@ -2263,7 +2263,7 @@ describe('facebook limited auth adapter', () => {
22632263
}
22642264
});
22652265

2266-
it('should throw error with with invalid user id', async () => {
2266+
it_id('c194d902-e697-46c9-a303-82c2d914473c', 'should throw error with with invalid user id (facebook.com)', async () => {
22672267
const fakeClaim = {
22682268
iss: 'https://www.facebook.com',
22692269
aud: 'invalid_client_id',

spec/CLI.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ describe('execution', () => {
248248
}
249249
});
250250

251-
it('should start Parse Server', done => {
251+
it_id('a0ab74b4-f805-4e03-b31d-b5cd59e64495', 'should start Parse Server', done => {
252252
const env = { ...process.env };
253253
env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation';
254254
childProcess = spawn(
@@ -261,7 +261,7 @@ describe('execution', () => {
261261
handleError(childProcess, done);
262262
});
263263

264-
it('should start Parse Server with GraphQL', async done => {
264+
it_id('d7165081-b133-4cba-901b-19128ce41301', 'should start Parse Server with GraphQL', async done => {
265265
const env = { ...process.env };
266266
env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation';
267267
childProcess = spawn(
@@ -287,7 +287,7 @@ describe('execution', () => {
287287
handleError(childProcess, done);
288288
});
289289

290-
it('should start Parse Server with GraphQL and Playground', async done => {
290+
it_id('2769cdb4-ce8a-484d-8a91-635b5894ba7e', 'should start Parse Server with GraphQL and Playground', async done => {
291291
const env = { ...process.env };
292292
env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation';
293293
childProcess = spawn(
@@ -315,7 +315,7 @@ describe('execution', () => {
315315
handleError(childProcess, done);
316316
});
317317

318-
it('can start Parse Server with auth via CLI', done => {
318+
it_id('23caddd7-bfea-4869-8bd4-0f2cd283c8bd', 'can start Parse Server with auth via CLI', done => {
319319
const env = { ...process.env };
320320
env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation';
321321
childProcess = spawn(

spec/CloudCode.spec.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,7 @@ describe('beforeFind hooks', () => {
23172317
);
23182318
});
23192319

2320-
it('should handle empty where', done => {
2320+
it_id('6ef0d226-af30-4dfd-8306-972a1b4becd3', 'should handle empty where', done => {
23212321
Parse.Cloud.beforeFind('MyObject', req => {
23222322
const otherQuery = new Parse.Query('MyObject');
23232323
otherQuery.equalTo('some', true);
@@ -2919,7 +2919,7 @@ describe('afterFind hooks', () => {
29192919
}).toThrow('Only the _Session class is allowed for the afterLogout trigger.');
29202920
});
29212921

2922-
it('should skip afterFind hooks for aggregate', done => {
2922+
it_id('c16159b5-e8ee-42d5-8fe3-e2f7c006881d', 'should skip afterFind hooks for aggregate', done => {
29232923
const hook = {
29242924
method: function () {
29252925
return Promise.reject();
@@ -2946,7 +2946,7 @@ describe('afterFind hooks', () => {
29462946
});
29472947
});
29482948

2949-
it('should skip afterFind hooks for distinct', done => {
2949+
it_id('ca55c90d-36db-422c-9060-a30583ce5224', 'should skip afterFind hooks for distinct', done => {
29502950
const hook = {
29512951
method: function () {
29522952
return Promise.reject();
@@ -3033,7 +3033,7 @@ describe('afterFind hooks', () => {
30333033
expect(calledAfter).toBe(false);
30343034
});
30353035

3036-
it('should expose context in beforeSave/afterSave via header', async () => {
3036+
it_id('55ef1741-cf72-4a7c-a029-00cb75f53233', 'should expose context in beforeSave/afterSave via header', async () => {
30373037
let calledBefore = false;
30383038
let calledAfter = false;
30393039
Parse.Cloud.beforeSave('TestObject', req => {
@@ -3347,7 +3347,7 @@ describe('beforeLogin hook', () => {
33473347
expect(response).toEqual(error);
33483348
});
33493349

3350-
it('should have expected data in request', async done => {
3350+
it_id('5656d6d7-65ef-43d1-8ca6-6942ae3614d5', 'should have expected data in request in beforeLogin', async done => {
33513351
Parse.Cloud.beforeLogin(req => {
33523352
expect(req.object).toBeDefined();
33533353
expect(req.user).toBeUndefined();
@@ -3464,7 +3464,7 @@ describe('afterLogin hook', () => {
34643464
done();
34653465
});
34663466

3467-
it('should have expected data in request', async done => {
3467+
it_id('e86155c4-62e1-4c6e-ab4a-9ac6c87c60f2')('should have expected data in request in afterLogin', async done => {
34683468
Parse.Cloud.afterLogin(req => {
34693469
expect(req.object).toBeDefined();
34703470
expect(req.user).toBeDefined();

spec/CloudCodeLogger.spec.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('Cloud Code Logger', () => {
3737
// Note that helpers takes care of logout.
3838
// see helpers.js:afterEach
3939

40-
it('should expose log to functions', () => {
40+
it_id('02d53b97-3ec7-46fb-abb6-176fd6e85590')('should expose log to functions', () => {
4141
const spy = spyOn(Config.get('test').loggerController, 'log').and.callThrough();
4242
Parse.Cloud.define('loggerTest', req => {
4343
req.log.info('logTest', 'info log', { info: 'some log' });
@@ -67,7 +67,7 @@ describe('Cloud Code Logger', () => {
6767
});
6868
});
6969

70-
it('trigger should obfuscate password', done => {
70+
it_id('768412f5-d32f-4134-89a6-08949781a6c0')('trigger should obfuscate password', done => {
7171
Parse.Cloud.beforeSave(Parse.User, req => {
7272
return req.object;
7373
});
@@ -82,7 +82,7 @@ describe('Cloud Code Logger', () => {
8282
.then(null, e => done.fail(e));
8383
});
8484

85-
it('should expose log to trigger', done => {
85+
it_id('3c394047-272e-4728-9d02-9eaa660d2ed2')('should expose log to trigger', done => {
8686
Parse.Cloud.beforeSave('MyObject', req => {
8787
req.log.info('beforeSave MyObject', 'info log', { info: 'some log' });
8888
req.log.error('beforeSave MyObject', 'error log', {
@@ -120,7 +120,7 @@ describe('Cloud Code Logger', () => {
120120
expect(truncatedString.length).toBe(1015); // truncate length + the string '... (truncated)'
121121
});
122122

123-
it('should truncate input and result of long lines', done => {
123+
it_id('4a009b1f-9203-49ca-8d48-5b45f4eedbdf')('should truncate input and result of long lines', done => {
124124
const longString = fs.readFileSync(loremFile, 'utf8');
125125
Parse.Cloud.define('aFunction', req => {
126126
return req.params;
@@ -138,7 +138,7 @@ describe('Cloud Code Logger', () => {
138138
.then(null, e => done.fail(e));
139139
});
140140

141-
it('should log an afterSave', done => {
141+
it_id('9857e15d-bb18-478d-8a67-fdaad3e89565')('should log an afterSave', done => {
142142
Parse.Cloud.afterSave('MyObject', () => {});
143143
new Parse.Object('MyObject')
144144
.save()
@@ -151,7 +151,7 @@ describe('Cloud Code Logger', () => {
151151
.then(null, e => done.fail(e));
152152
});
153153

154-
it('should log a denied beforeSave', done => {
154+
it_id('ec13a296-f8b1-4fc6-985a-3593462edd9c')('should log a denied beforeSave', done => {
155155
Parse.Cloud.beforeSave('MyObject', () => {
156156
throw 'uh oh!';
157157
});
@@ -174,7 +174,7 @@ describe('Cloud Code Logger', () => {
174174
});
175175
});
176176

177-
it('should log cloud function success', done => {
177+
it_id('3e0caa45-60d6-41af-829a-fd389710c132')('should log cloud function success', done => {
178178
Parse.Cloud.define('aFunction', () => {
179179
return 'it worked!';
180180
});
@@ -189,7 +189,7 @@ describe('Cloud Code Logger', () => {
189189
});
190190
});
191191

192-
it('should log cloud function execution using the custom log level', async done => {
192+
it_id('8088de8a-7cba-4035-8b05-4a903307e674')('should log cloud function execution using the custom log level', async done => {
193193
Parse.Cloud.define('aFunction', () => {
194194
return 'it worked!';
195195
});
@@ -260,7 +260,7 @@ describe('Cloud Code Logger', () => {
260260
expect(calls).toEqual({ beforeSave: 'warn', afterSave: undefined });
261261
});
262262

263-
it('should log cloud function failure', done => {
263+
it_id('97e0eafa-cde6-4a9a-9e53-7db98bacbc62')('should log cloud function failure', done => {
264264
Parse.Cloud.define('aFunction', () => {
265265
throw 'it failed!';
266266
});
@@ -311,7 +311,7 @@ describe('Cloud Code Logger', () => {
311311
.then(null, e => done.fail(JSON.stringify(e)));
312312
}).pend('needs more work.....');
313313

314-
it('cloud function should obfuscate password', done => {
314+
it_id('b86e8168-8370-4730-a4ba-24ca3016ad66')('cloud function should obfuscate password', done => {
315315
Parse.Cloud.define('testFunction', () => {
316316
return 'verify code success';
317317
});

spec/DefinedSchemas.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ describe('DefinedSchemas', () => {
642642

643643
expect(logger.error).toHaveBeenCalledWith(`Failed to run migrations: ${error.toString()}`);
644644
});
645-
it('should perform migration in parallel without failing', async () => {
645+
646+
it_id('a18bf4f2-25c8-4de3-b986-19cb1ab163b8')('should perform migration in parallel without failing', async () => {
646647
const server = await reconfigureServer();
647648
const logger = require('../lib/logger').logger;
648649
spyOn(logger, 'error').and.callThrough();

0 commit comments

Comments
 (0)