Skip to content

Commit

Permalink
fix tests for vendor css update
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiip committed Apr 2, 2015
1 parent 82950a4 commit a05c458
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/node/test-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ describe('gulp-angular generator techs script', function () {
ui: { key: 'testUi' },
jsPreprocessor: { extension: 'testExtension' }
};
read.withArgs('template/src/app/__ngroute.testExtension')
read.withArgs('template/src/app/_ngroute/__ngroute.testExtension')
.returns('my test content 1');
generator.computeRouter();
generator.routerHtml.should.match(/ng-view/);
generator.routerJs.should.equal('my test content 1');

generator.props.router.module = 'ui.router';
read.withArgs('template/src/app/__uirouter.testExtension')
read.withArgs('template/src/app/_uirouter/__uirouter.testExtension')
.returns('my test content 2');
generator.computeRouter();
generator.routerHtml.should.match(/ui-view/);
Expand Down
2 changes: 1 addition & 1 deletion test/node/test-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('gulp-angular generator ui script', function () {
generator.files = [];
generator.uiFiles();
generator.files[0].src.should.be.equal('src/app/components/navbar/__none-navbar.html');
generator.files[1].src.should.be.equal('src/app/__none-index.scss');
generator.files[1].src.should.be.equal('src/app/_none/__none-index.scss');
generator.files.length.should.be.equal(2);
});

Expand Down
16 changes: 4 additions & 12 deletions test/template/test-index-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,16 @@ describe('gulp-angular index js template', function () {
});

it('should insert the vendor build block depending of data', function() {
model.props.ui.key = 'bootstrap';
model.props.cssPreprocessor.key = 'none';
model.props.paths.src = 'src';
model.props.paths.tmp = 'tmp';
model.computedPaths.appToBower = 'appToBower';
model.isVendorStylesPreprocessed = false;
var result = indexHtml(model);
result.should.match(/<!-- build:css\({tmp\/serve,src}\) styles\/vendor\.css -->/);
result.should.match(/<!-- bower:css/);
result.should.match(/href="appToBower\/bower_components/);
result.should.not.match(/<link rel="stylesheet" href="app\/vendor\.css">/);

model.props.ui.key = 'foundation';
model.props.cssPreprocessor.key = 'notnone';
result = indexHtml(model);
result.should.not.match(/href="appToBower\/bower_components/);

model.isVendorStylesPreprocessed = true;
result = indexHtml(model);
result.should.not.match(/href="appToBower\/bower_components/);
result.should.match(/href="app\/vendor.css"/);
result.should.match(/<link rel="stylesheet" href="app\/vendor\.css">/);
});

it('should insert modernizr if selected', function() {
Expand Down

0 comments on commit a05c458

Please sign in to comment.