Add a test to cover the Jenkins core compatibility

This commit is contained in:
R. Tyler Croy 2018-10-27 15:24:25 -07:00
parent 3c5104ecfd
commit c0437dd079
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 10 additions and 0 deletions

View File

@ -90,6 +90,16 @@ describe('Events service tests', () => {
},
};
it('should match the transform that the Jenkins core code uses', () => {
const correlator = "00000000-0000-0000-0000-000000000000";
const hashedCorrelator = '90ecf3ce1cd5ba1e5ad3cde7ad08a941e884f2e4d9bd463361715abab8efedc5';
const eventType = 'test-data';
context.data.correlator = correlator;
context.data.type = eventType;
return expect(EventsHooks.transformCorrelator(context)).resolves.toHaveProperty('data.correlator', hashedCorrelator);
});
it('should transform correlators that look like UUIDs', () => {
const correlator = '86e3f00d-b12a-4391-bbf2-6f01c1606e17';
context.data.correlator = correlator;