Skip to content

Commit

Permalink
feat(Setup): make Bootstrap 4 the new default
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

If you are using Bootstrap 3 and you don't have `bootstrapVersion` explicitly in the bootstrap config of your
`ember-cli-build.js`, then this change will implicitly switch to Bootstrap 4. In this case please run
`ember g ember-bootstrap --bootstrapVersion=3` to fix it at version 3!
  • Loading branch information
simonihmig committed Jun 22, 2018
1 parent 6c09b25 commit ee0767b
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 206 deletions.
2 changes: 1 addition & 1 deletion blueprints/ember-bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
existingConfiguration: null,

beforeInstall(option) {
let bootstrapVersion = parseInt(option.bootstrapVersion, 10) || this.retrieveBootstrapVersion() || 3;
let bootstrapVersion = parseInt(option.bootstrapVersion, 10) || this.retrieveBootstrapVersion() || 4;
let preprocessor = option.preprocessor;

if (bootstrapVersion !== 3 && bootstrapVersion !== 4) {
Expand Down
8 changes: 4 additions & 4 deletions fastboot-tests/accordion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ describe('accordion', function() {

expect(response.statusCode).to.equal(200);
expect($('#accordion').length).to.equal(1);
expect($('#accordion .panel').length).to.equal(3);
expect($('#accordion .panel:eq(0) .panel-title').text().trim()).to.equal('First item');
expect($('#accordion .panel:eq(1) .panel-title').text().trim()).to.equal('Second item');
expect($('#accordion .card').length).to.equal(3);
expect($('#accordion .card:eq(0) .card-header').text().trim()).to.equal('First item');
expect($('#accordion .card:eq(1) .card-header').text().trim()).to.equal('Second item');
});
});

});
});
5 changes: 3 additions & 2 deletions fastboot-tests/carousel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ describe('carousel', function() {
expect($('#carousel').length).to.equal(1);
expect($('#carousel').hasClass('carousel')).to.be.true;
expect($('#carousel').hasClass('slide')).to.be.true;
expect($('#carousel .carousel-control').length).to.equal(2);
expect($('#carousel .carousel-inner .item').length).to.equal(3);
expect($('#carousel .carousel-control-next').length).to.equal(1);
expect($('#carousel .carousel-control-prev').length).to.equal(1);
expect($('#carousel .carousel-inner .carousel-item').length).to.equal(3);
});
});
});
3 changes: 1 addition & 2 deletions fastboot-tests/dropdown-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ describe('dropdown', function() {
expect($('#dropdown').length).to.equal(1);
expect($('#dropdown').hasClass('btn-group')).to.be.true;
expect($('#dropdown button').hasClass('dropdown-toggle')).to.be.true;
expect($('#dropdown ul').hasClass('dropdown-menu')).to.be.true;
});
});

});
});
4 changes: 2 additions & 2 deletions fastboot-tests/form-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ describe('form', function() {

expect(response.statusCode).to.equal(200);
expect($('form#form').length).to.equal(1);
expect($('form .form-group').length).to.equal(4);
expect($('form .form-group').length).to.equal(3);
expect($('form .form-group:eq(0) label').text().trim()).to.equal('Email');
expect($('form .form-group:eq(0) input[type=email]').length).to.equal(1);
});
});

});
});
8 changes: 4 additions & 4 deletions fastboot-tests/modal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ describe('modal', function() {

// default modal
expect($('#modal').length).to.equal(1);
expect($('#modal .modal.in').length).to.equal(1);
expect($('#modal .modal.show').length).to.equal(1);
expect($('#modal .modal').css('display')).to.equal('block');
expect($('#modal .modal-backdrop.in').length).to.equal(1);
expect($('#modal .modal-backdrop.show').length).to.equal(1);
expect($('#modal .modal .modal-header .modal-title').text().trim()).to.equal('modal header');
expect($('#modal .modal .modal-body').text().trim()).to.equal('modal body');

// hidden modal
expect($('#modal-hidden').length).to.equal(1);
expect($('#modal-hidden .modal.in').length).to.equal(0);
expect($('#modal-hidden .modal.show').length).to.equal(0);
});
});

});
});
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const resolve = require('resolve');
const defaultOptions = {
importBootstrapTheme: false,
importBootstrapCSS: true,
importBootstrapFont: true,
importBootstrapFont: false,
insertEmberWormholeElementToDom: true,
bootstrapVersion: 3
bootstrapVersion: 4
};

const supportedPreprocessors = [
Expand Down
Loading

0 comments on commit ee0767b

Please sign in to comment.