test: Add test IDs (#9205)

This commit is contained in:
Manuel
2024-07-18 15:41:04 +02:00
committed by GitHub
parent 4b04c2222c
commit 901cff5edd
42 changed files with 302 additions and 282 deletions

View File

@@ -32,7 +32,7 @@ describe('middlewares', () => {
AppCache.del(fakeReq.body._ApplicationId);
});
it('should use _ContentType if provided', done => {
it_id('4cc18d90-1763-4725-97fa-f63fb4692fc4')('should use _ContentType if provided', done => {
AppCachePut(fakeReq.body._ApplicationId, {
masterKeyIps: ['127.0.0.1'],
});
@@ -128,7 +128,7 @@ describe('middlewares', () => {
const otherKeys = BodyKeys.filter(
otherKey => otherKey !== infoKey && otherKey !== 'javascriptKey'
);
it(`it should pull ${bodyKey} into req.info`, done => {
it_id('f9abd7ac-b1f4-4607-b9b0-365ff0559d84')(`it should pull ${bodyKey} into req.info`, done => {
AppCachePut(fakeReq.body._ApplicationId, {
masterKeyIps: ['0.0.0.0/0'],
});
@@ -147,7 +147,7 @@ describe('middlewares', () => {
});
});
it('should not succeed and log if the ip does not belong to masterKeyIps list', async () => {
it_id('4a0bce41-c536-4482-a873-12ed023380e2')('should not succeed and log if the ip does not belong to masterKeyIps list', async () => {
const logger = require('../lib/logger').logger;
spyOn(logger, 'error').and.callFake(() => {});
AppCachePut(fakeReq.body._ApplicationId, {
@@ -197,7 +197,7 @@ describe('middlewares', () => {
);
});
it('should succeed if the ip does belong to masterKeyIps list', async () => {
it_id('2f7fadec-a87c-4626-90d1-65c75653aea9')('should succeed if the ip does belong to masterKeyIps list', async () => {
AppCachePut(fakeReq.body._ApplicationId, {
masterKey: 'masterKey',
masterKeyIps: ['10.0.0.1'],
@@ -208,7 +208,7 @@ describe('middlewares', () => {
expect(fakeReq.auth.isMaster).toBe(true);
});
it('should allow any ip to use masterKey if masterKeyIps is empty', async () => {
it_id('2b251fd4-d43c-48f4-ada9-c8458e40c12a')('should allow any ip to use masterKey if masterKeyIps is empty', async () => {
AppCachePut(fakeReq.body._ApplicationId, {
masterKey: 'masterKey',
masterKeyIps: ['0.0.0.0/0'],