bp - tests - simplified
MODIFY
test/api/BillingPlatformTest.ts
test/api/BillingPlatformTest.ts
@@ -27,16 +27,12 @@ const billingTestHelper = new BillingTestHelper();
const describeif = (condition) => condition ? describe : describe.skip;
const isBillingProperlyConfigured = BillingTestConfigHelper.isBillingProperlyConfigured();
-describeif(isBillingProperlyConfigured)('Billing', () => {
+describeif(isBillingProperlyConfigured)('Billing Platform (utbillingplatform)', () => {
jest.setTimeout(60000);
beforeAll(async () => {
global.database = new MongoDBStorage(config.get('storage'));
await global.database.start();
- });
-
- describe('Billing Platform (utbillingplatform)', () => {
- beforeAll(async () => {
await billingTestHelper.initialize(ContextDefinition.TENANT_CONTEXTS.TENANT_BILLING_PLATFORM);
// Initialize the Billing module
await billingTestHelper.setBillingSystemValidCredentials();
@@ -402,27 +398,5 @@ describeif(isBillingProperlyConfigured)('Billing', () => {
});
});
- describe('Transfer Storage', () => {
- it('should save a billing transfer', async () => {
- const transfer = BillingTransferFactory.build();
- const transferID = await BillingStorage.saveTransfer(billingTestHelper.getTenant(), transfer);
- expect(transferID).to.not.be.null;
-
- const retrievedTransfer = await BillingStorage.getTransfer(billingTestHelper.getTenant(), transferID);
- expect(retrievedTransfer).to.containSubset(transfer);
- });
-
- it('should list billing transfers', async () => {
- const transfers = [
- BillingTransferFactory.build(),
- BillingTransferFactory.build(),
- ];
- const ids = await Promise.all(transfers.map(async (transfer) => BillingStorage.saveTransfer(billingTestHelper.getTenant(), transfer)));
- const retrievedTransfers = await BillingStorage.getTransfers(billingTestHelper.getTenant(), {}, Constants.DB_PARAMS_MAX_LIMIT);
- expect(retrievedTransfers.result.map((transfer) => transfer.id)).to.include.members(ids);
- });
- });
-
- });
});

bp - tests - simplified