Skip to content

Commit

Permalink
Merge pull request #27 from rylan/patch-1
Browse files Browse the repository at this point in the history
Updating UMDAppConfigBuilder with showLoading option
  • Loading branch information
dlockhart committed Jun 2, 2015
2 parents cde0362 + 2549cc0 commit a08b416
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "free-range-app-utils",
"version": "0.4.0",
"version": "0.5.0",
"description": "Utilities for building free-range apps.",
"main": "main.js",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/umdAppConfigBuilder.js
Expand Up @@ -8,12 +8,14 @@ function build(target, opts) {
if ( !target ) {
throw new Error('Missing target');
}


opts = opts || {};
var loader = {
schema: "http://apps.d2l.com/uiapps/umdschema/v1.json",
endpoint: target
endpoint: target,
showLoading: opts.showLoading ? true : false
};

return builder.build( opts, loader );
}

Expand Down
12 changes: 11 additions & 1 deletion test/umdAppConfigBuilder.js
Expand Up @@ -32,6 +32,15 @@ describe('umdAppConfigBuilder', function(){
it('should have correct endpoint', function(){
builder.build(TARGET, OPTS).loader.should.have.property('endpoint', TARGET );
});

it('should have correct property showLoading', function() {
builder.build(TARGET, OPTS).loader.should.have.property('showLoading', true);

});

it('should have property showLoading as false with OPTS undefined', function() {
builder.build(TARGET).loader.should.have.property('showLoading', false);
});
});
});
});
Expand All @@ -41,6 +50,7 @@ function createValidOpts() {
name: 'some-name',
version: '1.0.0.1',
description: 'It is a small world',
id: 'some-id'
id: 'some-id',
showLoading: true
};
}

0 comments on commit a08b416

Please sign in to comment.