Skip to content

test: Add test IDs #9205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions spec/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"expectAsync": true,
"notEqual": true,
"it_id": true,
"fit_id": true,
"it_only_db": true,
"it_only_mongodb_version": true,
"it_only_postgres_version": true,
Expand All @@ -27,6 +28,7 @@
"fit_exclude_mongodb_version": true,
"fit_exclude_node_version": true,
"it_exclude_dbs": true,
"fit_exclude_dbs": true,
"describe_only_db": true,
"fdescribe_only_db": true,
"describe_only": true,
Expand Down
4 changes: 2 additions & 2 deletions spec/AudienceRouter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('AudiencesRouter', () => {
);
});

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

it('should be able to search on audiences', done => {
Parse._request(
Expand Down
30 changes: 15 additions & 15 deletions spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ describe('google auth adapter', () => {
// }
// });

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

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

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

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

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

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

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

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

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

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

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

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

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

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

it('should throw error with with invalid user id', async () => {
it_id('c194d902-e697-46c9-a303-82c2d914473c', 'should throw error with with invalid user id (facebook.com)', async () => {
const fakeClaim = {
iss: 'https://www.facebook.com',
aud: 'invalid_client_id',
Expand Down
8 changes: 4 additions & 4 deletions spec/CLI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ describe('execution', () => {
}
});

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

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

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

it('can start Parse Server with auth via CLI', done => {
it_id('23caddd7-bfea-4869-8bd4-0f2cd283c8bd', 'can start Parse Server with auth via CLI', done => {
const env = { ...process.env };
env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation';
childProcess = spawn(
Expand Down
12 changes: 6 additions & 6 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2317,7 +2317,7 @@ describe('beforeFind hooks', () => {
);
});

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

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

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

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

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

it('should have expected data in request', async done => {
it_id('e86155c4-62e1-4c6e-ab4a-9ac6c87c60f2')('should have expected data in request in afterLogin', async done => {
Parse.Cloud.afterLogin(req => {
expect(req.object).toBeDefined();
expect(req.user).toBeDefined();
Expand Down
20 changes: 10 additions & 10 deletions spec/CloudCodeLogger.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Cloud Code Logger', () => {
// Note that helpers takes care of logout.
// see helpers.js:afterEach

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

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

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

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

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

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

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

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

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

it('cloud function should obfuscate password', done => {
it_id('b86e8168-8370-4730-a4ba-24ca3016ad66')('cloud function should obfuscate password', done => {
Parse.Cloud.define('testFunction', () => {
return 'verify code success';
});
Expand Down
3 changes: 2 additions & 1 deletion spec/DefinedSchemas.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@ describe('DefinedSchemas', () => {

expect(logger.error).toHaveBeenCalledWith(`Failed to run migrations: ${error.toString()}`);
});
it('should perform migration in parallel without failing', async () => {

it_id('a18bf4f2-25c8-4de3-b986-19cb1ab163b8')('should perform migration in parallel without failing', async () => {
const server = await reconfigureServer();
const logger = require('../lib/logger').logger;
spyOn(logger, 'error').and.callThrough();
Expand Down
Loading
Loading