All files / test dataProvider.ts

100% Statements 21/21
100% Branches 0/0
100% Functions 1/1
100% Lines 21/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 403x 3x 3x 3x 3x 3x 3x   3x   3x 3x         3x 3x   3x 3x 3x   3x       3x 3x       3x 3x       3x    
import { appInstall, DEFAULT_ACCESS_TOKEN, DEFAULT_USER } from '@orchesty/nodejs-connectors/test/DataProvider';
import { container, db, sender } from '@orchesty/nodejs-connectors/test/TestAbstract';
import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
import { TOKEN } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
import ProductboardListAllFeaturesBatch from '../src/Batch/ProductboardListAllFeaturesBatch';
import ProductboardListAllProductsBatch from '../src/Batch/ProductboardListAllProductsBatch';
import ProductboardCreateNewFeatureConnector
    from '../src/Connector/ProductboardCreateNewFeatureConnector';
import ProductboardApplication, { NAME as PRODUCTBOARD_APP } from '../src/ProductboardApplication';
 
export default function init(): void {
    appInstall(PRODUCTBOARD_APP, DEFAULT_USER, {
        [CoreFormsEnum.AUTHORIZATION_FORM]: {
            [TOKEN]: DEFAULT_ACCESS_TOKEN,
        },
    });
    const app = new ProductboardApplication();
    container.setApplication(app);
 
    const listAllFeatures = new ProductboardListAllFeaturesBatch();
    const listAllProducts = new ProductboardListAllProductsBatch();
    const createNewFeature = new ProductboardCreateNewFeatureConnector();
 
    listAllFeatures
        .setSender(sender)
        .setDb(db)
        .setApplication(app);
    container.setBatch(listAllFeatures);
    listAllProducts
        .setSender(sender)
        .setDb(db)
        .setApplication(app);
    container.setBatch(listAllProducts);
    createNewFeature
        .setSender(sender)
        .setDb(db)
        .setApplication(app);
    container.setConnector(createNewFeature);
}