var helper = require("../../helper");
var Manager = require("../../../src/etl/dim-category-etl-manager");
var instanceManager = null;
var should = require("should");
var sqlHelper = require("../../sql-helper");

before("#00. connect db", function (done) {
    Promise.all([helper, sqlHelper])
    .then((result) => {
        var db = result[0];
        var sql = result[1];
        db.getDb().then((db) => {
            instanceManager = new Manager(db, {
                username: "unit-test"
            }, sql);
            done();
        })
        .catch((e) => {
            done(e);
        })
    });
});

it("#01. should success when create etl for dim-category", function(done) {
    instanceManager.run()
        .then(() => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});

it("#02. should success when transforming data for dim-category", function(done) {
    var data = [{}, {}];
    instanceManager.transform(data)
        .then(() => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});

// it("#03. should success when load data for dim-category", function(done) {
//     var data = [[], []];
//     instanceManager.load(data)
//         .then(() => {
//             done();
//         })
//         .catch((e) => {
//             done(e);
//         });
// });
@@ -821,24 +821,27 @@
    %7D);%0A%7D);%0A%0A
+// 
 it(%22#02. sho
@@ -907,24 +907,27 @@
 ion(done) %7B%0A
+// 
     var data
@@ -939,20 +939,23 @@
 %7D, %7B%7D%5D;%0A
+//
     
+ 
 instance
@@ -978,16 +978,19 @@
 m(data)%0A
+// 
         
@@ -995,32 +995,35 @@
   .then(() =%3E %7B%0A
+// 
             done
@@ -1018,32 +1018,35 @@
         done();%0A
+// 
         %7D)%0A     
@@ -1032,32 +1032,35 @@
 ;%0A//         %7D)%0A
+// 
         .catch((
@@ -1059,32 +1059,34 @@
 .catch((e) =%3E %7B%0A
+//
             done
@@ -1073,32 +1073,33 @@
 %7B%0A//            
+ 
 done(e);%0A       
@@ -1083,32 +1083,35 @@
        done(e);%0A
+// 
         %7D);%0A%7D);%0A
@@ -1098,32 +1098,35 @@
 %0A//         %7D);%0A
+// 
 %7D);%0A%0A// it(%22#03.

update unit test