<commit_before>"use strict";
var _getSert = require("../getsert");
var generateCode = require("../../../src/utils/code-generator");
var UomDataUtil = require("./uom-data-util");

class StepDataUtil {
    getSert(input) {
        var StepType = require("../../../src/managers/master/step-manager");
        return _getSert(input, StepType, (data) => {
            return {
                process: data.process
            };
        });
    }

    getNewData() {
        return UomDataUtil.getTestData()
            .then(uom => {
                var Model = require("dl-models").master.Step;
                var data = new Model();

                var code = generateCode();

                data.process = code;
                var item1 = `data 1 ${code}`;
                var item2 = `data 2 ${code}`;
                data.itemMonitoring.push(item1);
                data.itemMonitoring.push(item2);

                var process1 = {
                    name : `data 1 ${code}`,
                    value : `value 1 ${code}`,
                    uomId : uom._id,
                    uom : uom
                } 
                var process2 = {
                    name : `data 2 ${code}`,
                    value : `value 2 ${code}`,
                    uomId : uom._id,
                    uom : uom
                }
                data.stepIndicators.push(process1);
                data.stepIndicators.push(process2); 

                return Promise.resolve(data);
            });
    }

    getTestData(data, items, indicator) {
        return UomDataUtil.getTestData()
            .then(uom => {
                var _process = data ? data : "GAS SINGEING DAN DESIZING";
                var _itemMonitoring = items ? items : [
                        'Speed (m/mnt)', 'Pressure Burner (mBar)', 'Titik Api', 'Pressure Saturator (Bar)', 'Hasil Bakar Bulu (baik/tidak)'
                    ];
                var _stepIndicator = indicator ? indicator : [
                    {
                        name : 'SETTING',
                        value : '3'
                    },
                    {
                        name : 'PRESS. BURNER',
                        value : '14',
                        uomId : uom._id,
                        uom : uom
                    },
                    {
                        name : 'TEMP. SATURATOR',
                        value : '65',
                        uomId : uom._id,
                        uom : uom
                    },
                    {
                        name : 'SPEED',
                        value : '90',
                        uomId : uom._id,
                        uom : uom
                    },
                    {
                        name : '<NAME>',
                        value : '3'
                    },
                    {
                        name : 'LE<NAME>',
                        value : '',
                        uomId : uom._id,
                        uom : uom
                    },
                    {
                        name : 'COUNTER',
                        value : ''
                    }
                ];
                var data = {
                    process: _process,
                    itemMonitoring:_itemMonitoring,
                    stepIndicators:_stepIndicator
                };
                return this.getSert(data);
            });
    }
}<commit_msg>update unit test step indicator<commit_after>"use strict";
var _getSert = require("../getsert");
var generateCode = require("../../../src/utils/code-generator");
var UomDataUtil = require("./uom-data-util");

class StepDataUtil {
    getSert(input) {
        var StepType = require("../../../src/managers/master/step-manager");
        return _getSert(input, StepType, (data) => {
            return {
                process: data.process
            };
        });
    }

    getNewData() {
        return UomDataUtil.getTestData()
            .then(uom => {
                var Model = require("dl-models").master.Step;
                var data = new Model();

                var code = generateCode();

                data.process = code;
                var item1 = `data 1 ${code}`;
                var item2 = `data 2 ${code}`;
                data.itemMonitoring.push(item1);
                data.itemMonitoring.push(item2);

                var process1 = {
                    name : `data 1 ${code}`,
                    value : `value 1 ${code}`,
                    uom : `uom 1 ${code}`
                } 
                var process2 = {
                    name : `data 2 ${code}`,
                    value : `value 2 ${code}`,
                    uom : `uom 2 ${code}`
                }
                data.stepIndicators.push(process1);
                data.stepIndicators.push(process2); 

                return Promise.resolve(data);
            });
    }

    getTestData(data, items, indicator) {
        return UomDataUtil.getTestData()
            .then(uom => {
                var _process = data ? data : "GAS SINGEING DAN DESIZING";
                var _itemMonitoring = items ? items : [
                        'Speed (m/mnt)', 'Pressure Burner (mBar)', 'Titik Api', 'Pressure Saturator (Bar)', 'Hasil Bakar Bulu (baik/tidak)'
                    ];
                var _stepIndicator = indicator ? indicator : [
                    {
                        name : 'SETTING',
                        value : '3'
                    },
                    {
                        name : 'PRESS. BURNER',
                        value : '14',
                        uom : "mBar"
                    },
                    {
                        name : 'TEMP. SATURATOR',
                        value : '65',
                        uom : "C"
                    },
                    {
                        name : 'SPEED',
                        value : '90',
                        uom : "m/mnt"
                    },
                    {
                        name : 'TITIK API',
                        value : '3'
                    },
                    {
                        name : '<NAME>',
                        value : '',
                        uom : "METER"
                    },
                    {
                        name : 'COUNTER',
                        value : ''
                    }
                ];
                 var data = {
                    process: _process,
                    itemMonitoring:_itemMonitoring,
                    stepIndicators:_stepIndicator
                };
                return this.getSert(data);
            });
    }
}
{'fraction_non_alphanumeric': 0.10944752208414434, 'fraction_numerical': 0.006887258571642461, 'mean_word_length': 0.8152173913043478, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2751924', 'n_tokens_mistral': 1747, 'n_tokens_neox': 1588, 'n_words': 341}