cluedin-widget
Version: 
This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.
31 lines (26 loc) • 1.13 kB
JavaScript
require( 'should' );
var fs                = require( 'fs' );
var widgetFileBuilder = require( '../src/widgetFileBuilder' );
var fileNameBuilder   = require( '../src/fileNameBUilder' );
var contentResult = "import '../widget/onBoarding/index.jsx';import '../widget/test/index.jsx';import '../core/components/bootstrap.jsx';";
describe( 'Given a widgetFileBUilder', function() {
    it( 'should exist', function() {
        widgetFileBuilder.should.exist;
    } );
    it( 'should have a build method', function() {
        widgetFileBuilder.build.should.exist;
    } );
    it( 'build method should return a content', function( done ) {
        var sut = fileNameBuilder.getFileName( 'test' );
        widgetFileBuilder.build( {
            fileName: sut,
            widgets: [ 'onBoarding', 'test' ]
        }, function( err, fileName ) {
            fileName.should.exist;
            fileName.should.equal( '/Users/dervalp/src/cluedin-widget/temp/test.js' );
            var content = fs.readFileSync( fileName ).toString();
            content.should.equal( contentResult );
            done();
        } );
    } );
} );