/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    generateThemeFaviconFiles = require('../../../../task/worker/generate_theme_favicon_files.js');

exports.setUp = function (done) {
    process.TASK_LOG_DISABLED = true;
    done();
};

exports.tearDown = function (done) {
    process.TASK_LOG_DISABLED = false;
    done();
};
exports['Name a favicon'] = function (test) {
    test.ok(generateThemeFaviconFiles._nameFaviconFile(2));
    test.ok(generateThemeFaviconFiles._nameFaviconFile(3));
    test.done();
};

exports['Get favicon data.'] = function (test) {
    var data = generateThemeFaviconFiles._faviconData(20, 4, [1, 2, 3], 4);
    test.equal(data.length, 4);
    test.done();
};

//Disable test because node-canvas , used in text2image is not on dependencies.
//
//exports['Generate theme favicon files.'] = function (test) {
//    var destDir = testResource.resolveWorkFile('work_theme_favicon_files');
//    testResource.prepareCleanWorkDir(destDir, function () {
//        generateThemeFaviconFiles({
//            destDir: destDir
//        }, function (err) {
//            test.ifError(err);
//            test.done();
//        });
//
//    });
//};