├── .editorconfig ├── .ember-cli ├── .eslintrc.js ├── .gitignore ├── .npmignore ├── .travis.yml ├── .watchmanconfig ├── LICENSE.md ├── README.md ├── config ├── ember-try.js └── environment.js ├── ember-cli-build.js ├── index.js ├── package.json ├── testem.js ├── tests ├── .eslintrc.js ├── dummy │ ├── app │ │ ├── app.js │ │ ├── index.html │ │ ├── resolver.js │ │ ├── router.js │ │ ├── styles │ │ │ └── app.scss │ │ └── templates │ │ │ ├── application.hbs │ │ │ └── components │ │ │ └── .gitkeep │ ├── config │ │ ├── environment.js │ │ └── targets.js │ └── public │ │ ├── crossdomain.xml │ │ └── robots.txt ├── helpers │ ├── destroy-app.js │ ├── module-for-acceptance.js │ ├── resolver.js │ └── start-app.js ├── index.html ├── integration │ ├── .gitkeep │ └── bootstrap-test.js └── test-helper.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parserOptions: { 4 | ecmaVersion: 2017, 5 | sourceType: 'module' 6 | }, 7 | extends: 'eslint:recommended', 8 | env: { 9 | browser: true 10 | }, 11 | rules: { 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log* 17 | yarn-error.log 18 | testem.log 19 | 20 | # ember-try 21 | .node_modules.ember-try/ 22 | bower.json.ember-try 23 | package.json.ember-try 24 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /bower_components 2 | /config/ember-try.js 3 | /dist 4 | /tests 5 | /tmp 6 | **/.gitkeep 7 | .bowerrc 8 | .editorconfig 9 | .ember-cli 10 | .gitignore 11 | .eslintrc.js 12 | .watchmanconfig 13 | .travis.yml 14 | bower.json 15 | ember-cli-build.js 16 | testem.js 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "4" 5 | 6 | sudo: false 7 | 8 | cache: 9 | yarn: true 10 | 11 | env: 12 | # we recommend testing LTS's and latest stable release (bonus points to beta/canary) 13 | - EMBER_TRY_SCENARIO=ember-lts-2.4 14 | - EMBER_TRY_SCENARIO=ember-lts-2.8 15 | - EMBER_TRY_SCENARIO=ember-release 16 | - EMBER_TRY_SCENARIO=ember-beta 17 | - EMBER_TRY_SCENARIO=ember-canary 18 | - EMBER_TRY_SCENARIO=ember-default 19 | 20 | matrix: 21 | fast_finish: true 22 | allow_failures: 23 | - env: EMBER_TRY_SCENARIO=ember-canary 24 | 25 | before_install: 26 | - curl -o- -L https://yarnpkg.com/install.sh | bash 27 | - export PATH=$HOME/.yarn/bin:$PATH 28 | - yarn global add phantomjs-prebuilt 29 | - phantomjs --version 30 | 31 | install: 32 | - yarn install --no-lockfile --non-interactive 33 | 34 | script: 35 | # Usually, it's ok to finish the test scenario without reverting 36 | # to the addon's original dependency state, skipping "cleanup". 37 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup 38 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ember-sass-bootstrap 2 | 3 | This is an Ember addon that makes 4 | [Bootstrap Sass](https://github.com/twbs/bootstrap-sass) available in 5 | your Ember app. Instead of just importing in the whole library, it 6 | provides as much or as little as you need, and it lets you easily 7 | customize Bootstrap's variables. 8 | 9 | It is also bower-dependency-free, by loading bootstrap-sass via npm instead. This avoids the need for it to reach out and mess with your own bower.json file. 10 | 11 | ## Installation 12 | 13 | The point of this addon is to be able to use Bootstrap via sass, so it 14 | expects that you also have ember-cli-sass installed. 15 | 16 | `ember install ember-cli-sass` 17 | `ember install ember-sass-bootstrap` 18 | 19 | ## Usage: Stylesheets 20 | 21 | If you want all of Bootstraps style, just say: 22 | 23 | @import 'bootstrap'; 24 | 25 | in your `app.scss` file. You can customize Bootstrap's variables by 26 | setting them before importing: 27 | 28 | $brand-primary: #ff0000; 29 | @import 'bootstrap'; 30 | 31 | You can also choose to import only the specific pieces that you need. For example: 32 | 33 | @import 'bootstrap/buttons'; 34 | 35 | ## Usage: Javascript Plugins 36 | 37 | By default, we will include all of Bootstrap's Javascript in your 38 | application. But you can control this from your ember-cli-build.js file: 39 | 40 | ```js 41 | new EmberApp(defaults, { 42 | bootstrap: { 43 | plugins: ['collapse', 'transition'] 44 | } 45 | }); 46 | 47 | ``` 48 | 49 | ## Usage: Fonts 50 | 51 | The Glyphicon font will Just Work™. The font files are always included 52 | in your app's build output, but that doesn't really cost anything 53 | unless you use them. 54 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-2.4', 6 | bower: { 7 | dependencies: { 8 | 'ember': 'components/ember#lts-2-4' 9 | }, 10 | resolutions: { 11 | 'ember': 'lts-2-4' 12 | } 13 | }, 14 | npm: { 15 | devDependencies: { 16 | 'ember-source': null 17 | } 18 | } 19 | }, 20 | { 21 | name: 'ember-lts-2.8', 22 | bower: { 23 | dependencies: { 24 | 'ember': 'components/ember#lts-2-8' 25 | }, 26 | resolutions: { 27 | 'ember': 'lts-2-8' 28 | } 29 | }, 30 | npm: { 31 | devDependencies: { 32 | 'ember-source': null 33 | } 34 | } 35 | }, 36 | { 37 | name: 'ember-release', 38 | bower: { 39 | dependencies: { 40 | 'ember': 'components/ember#release' 41 | }, 42 | resolutions: { 43 | 'ember': 'release' 44 | } 45 | }, 46 | npm: { 47 | devDependencies: { 48 | 'ember-source': null 49 | } 50 | } 51 | }, 52 | { 53 | name: 'ember-beta', 54 | bower: { 55 | dependencies: { 56 | 'ember': 'components/ember#beta' 57 | }, 58 | resolutions: { 59 | 'ember': 'beta' 60 | } 61 | }, 62 | npm: { 63 | devDependencies: { 64 | 'ember-source': null 65 | } 66 | } 67 | }, 68 | { 69 | name: 'ember-canary', 70 | bower: { 71 | dependencies: { 72 | 'ember': 'components/ember#canary' 73 | }, 74 | resolutions: { 75 | 'ember': 'canary' 76 | } 77 | }, 78 | npm: { 79 | devDependencies: { 80 | 'ember-source': null 81 | } 82 | } 83 | }, 84 | { 85 | name: 'ember-default', 86 | npm: { 87 | devDependencies: {} 88 | } 89 | } 90 | ] 91 | }; 92 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | module.exports = function(/* environment, appConfig */) { 5 | return { }; 6 | }; 7 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | module.exports = function(defaults) { 7 | let app = new EmberAddon(defaults, { 8 | bootstrap: { 9 | // This is used in our own tests to show that only selected plugins are present. 10 | plugins: ['collapse', 'transition'] 11 | } 12 | }); 13 | 14 | /* 15 | This build file specifies the options for the dummy test app of this 16 | addon, located in `/tests/dummy` 17 | This build file does *not* influence how the addon or the app using it 18 | behave. You most likely want to be modifying `./index.js` or app's build file 19 | */ 20 | 21 | return app.toTree(); 22 | }; 23 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | const path = require('path'); 5 | const stew = require('broccoli-stew'); 6 | const fbTransform = require('fastboot-transform'); 7 | 8 | module.exports = { 9 | name: 'ember-sass-bootstrap', 10 | 11 | treeForStyles() { 12 | return stew.mv(bootstrapAssetPath('stylesheets'), '.'); 13 | }, 14 | 15 | treeForPublic() { 16 | return stew.mv(bootstrapAssetPath('fonts'), 'fonts'); 17 | }, 18 | 19 | treeForVendor() { 20 | return fbTransform(stew.mv(bootstrapAssetPath('javascripts'), 'bootstrap')); 21 | }, 22 | 23 | included(app) { 24 | while (app.app) { 25 | app = app.app; 26 | } 27 | 28 | let plugins = (app.options.bootstrap || {}).plugins; 29 | if (Array.isArray(plugins)) { 30 | plugins.forEach(name => app.import('vendor/bootstrap/bootstrap/' + name + '.js')); 31 | } else if (typeof plugins === 'undefined' || plugins) { 32 | app.import('vendor/bootstrap/bootstrap.js'); 33 | } 34 | } 35 | }; 36 | 37 | function bootstrapAssetPath(which) { 38 | let bootstrapPath = require.resolve('bootstrap-sass'); 39 | return path.join(path.dirname(bootstrapPath), '..', which); 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-sass-bootstrap", 3 | "version": "0.2.0", 4 | "description": "Sass Bootstrap packages nicely for ember", 5 | "keywords": [ 6 | "ember-addon" 7 | ], 8 | "license": "MIT", 9 | "author": "Edward Faulkner ", 10 | "directories": { 11 | "doc": "doc", 12 | "test": "tests" 13 | }, 14 | "repository": "https://github.com/ef4/ember-sass-bootstrap", 15 | "scripts": { 16 | "build": "ember build", 17 | "start": "ember server", 18 | "test": "ember try:each" 19 | }, 20 | "dependencies": { 21 | "bootstrap-sass": "^3.3.6", 22 | "broccoli-stew": "^1.5.0", 23 | "ember-cli-babel": "^6.3.0", 24 | "fastboot-transform": "^0.1.2" 25 | }, 26 | "devDependencies": { 27 | "broccoli-asset-rev": "^2.4.5", 28 | "ember-cli": "~2.14.0", 29 | "ember-cli-dependency-checker": "^1.3.0", 30 | "ember-cli-eslint": "^4.1.0", 31 | "ember-cli-htmlbars": "^2.0.1", 32 | "ember-cli-htmlbars-inline-precompile": "^0.4.3", 33 | "ember-cli-inject-live-reload": "^1.4.1", 34 | "ember-cli-qunit": "^4.0.0", 35 | "ember-cli-sass": "^7.0.0", 36 | "ember-cli-shims": "^1.1.0", 37 | "ember-cli-sri": "^2.1.0", 38 | "ember-cli-uglify": "^1.2.0", 39 | "ember-disable-prototype-extensions": "^1.1.2", 40 | "ember-export-application-global": "^2.0.0", 41 | "ember-load-initializers": "^1.0.0", 42 | "ember-resolver": "^4.0.0", 43 | "ember-source": "~2.14.0", 44 | "loader.js": "^4.2.3" 45 | }, 46 | "engines": { 47 | "node": "^4.5 || 6.* || >= 7.*" 48 | }, 49 | "ember-addon": { 50 | "configPath": "tests/dummy/config" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | test_page: 'tests/index.html?hidepassed', 4 | disable_watching: true, 5 | launch_in_ci: [ 6 | 'PhantomJS' 7 | ], 8 | launch_in_dev: [ 9 | 'PhantomJS', 10 | 'Chrome' 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /tests/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | embertest: true 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | let App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | podModulePrefix: config.podModulePrefix, 13 | Resolver 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | 12 | 13 | 14 | 15 | {{content-for "head-footer"}} 16 | 17 | 18 | {{content-for "body"}} 19 | 20 | 21 | 22 | 23 | {{content-for "body-footer"}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | const Router = Ember.Router.extend({ 5 | location: config.locationType, 6 | rootURL: config.rootURL 7 | }); 8 | 9 | Router.map(function() { 10 | }); 11 | 12 | export default Router; 13 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.scss: -------------------------------------------------------------------------------- 1 | $brand-primary: rgb(255, 17, 119); 2 | @import 'bootstrap'; 3 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Welcome to Ember

2 | 3 |
4 | 5 |
6 | 7 | 10 | 11 |
12 |
13 | 14 | Anim pariatur cliche reprehenderit, enim eiusmod high life 15 | accusamus terry richardson ad squid. Nihil anim keffiyeh 16 | helvetica, craft beer labore wes anderson cred nesciunt sapiente 17 | ea proident. 18 | 19 |
20 |
-------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ef4/ember-sass-bootstrap/3c77cd2818c15dc6ac5ebdb6c2019bc41b15b035/tests/dummy/app/templates/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | module.exports = function(environment) { 5 | let ENV = { 6 | modulePrefix: 'dummy', 7 | environment, 8 | rootURL: '/', 9 | locationType: 'auto', 10 | EmberENV: { 11 | FEATURES: { 12 | // Here you can enable experimental features on an ember canary build 13 | // e.g. 'with-controller': true 14 | }, 15 | EXTEND_PROTOTYPES: { 16 | // Prevent Ember Data from overriding Date.parse. 17 | Date: false 18 | } 19 | }, 20 | 21 | APP: { 22 | // Here you can pass flags/options to your application instance 23 | // when it is created 24 | } 25 | }; 26 | 27 | if (environment === 'development') { 28 | // ENV.APP.LOG_RESOLVER = true; 29 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 30 | // ENV.APP.LOG_TRANSITIONS = true; 31 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 32 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 33 | } 34 | 35 | if (environment === 'test') { 36 | // Testem prefers this... 37 | ENV.locationType = 'none'; 38 | 39 | // keep test console output quieter 40 | ENV.APP.LOG_ACTIVE_GENERATION = false; 41 | ENV.APP.LOG_VIEW_LOOKUPS = false; 42 | 43 | ENV.APP.rootElement = '#ember-testing'; 44 | } 45 | 46 | if (environment === 'production') { 47 | 48 | } 49 | 50 | return ENV; 51 | }; 52 | -------------------------------------------------------------------------------- /tests/dummy/config/targets.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | browsers: [ 4 | 'ie 9', 5 | 'last 1 Chrome versions', 6 | 'last 1 Firefox versions', 7 | 'last 1 Safari versions' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/destroy-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default function destroyApp(application) { 4 | Ember.run(application, 'destroy'); 5 | } 6 | -------------------------------------------------------------------------------- /tests/helpers/module-for-acceptance.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import Ember from 'ember'; 3 | import startApp from '../helpers/start-app'; 4 | import destroyApp from '../helpers/destroy-app'; 5 | 6 | const { RSVP: { resolve } } = Ember; 7 | 8 | export default function(name, options = {}) { 9 | module(name, { 10 | beforeEach() { 11 | this.application = startApp(); 12 | 13 | if (options.beforeEach) { 14 | return options.beforeEach.apply(this, arguments); 15 | } 16 | }, 17 | 18 | afterEach() { 19 | let afterEach = options.afterEach && options.afterEach.apply(this, arguments); 20 | return resolve(afterEach).then(() => destroyApp(this.application)); 21 | } 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from '../../resolver'; 2 | import config from '../../config/environment'; 3 | 4 | const resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import config from '../../config/environment'; 4 | 5 | export default function startApp(attrs) { 6 | let attributes = Ember.merge({}, config.APP); 7 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 8 | 9 | return Ember.run(() => { 10 | let application = Application.create(attributes); 11 | application.setupForTesting(); 12 | application.injectTestHelpers(); 13 | return application; 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for "head-footer"}} 18 | {{content-for "test-head-footer"}} 19 | 20 | 21 | {{content-for "body"}} 22 | {{content-for "test-body"}} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for "body-footer"}} 31 | {{content-for "test-body-footer"}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/integration/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ef4/ember-sass-bootstrap/3c77cd2818c15dc6ac5ebdb6c2019bc41b15b035/tests/integration/.gitkeep -------------------------------------------------------------------------------- /tests/integration/bootstrap-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | import Ember from 'ember'; 4 | 5 | /* global setInterval, clearInterval */ 6 | 7 | moduleForComponent('Integration | Bootstrap', { 8 | integration: true 9 | }); 10 | 11 | test('bootstrap uses customized sass variables', function(assert) { 12 | 13 | this.render(hbs` 14 |
Hello World
15 | `); 16 | 17 | assert.equal(this.$('.text-primary').css('color'), 'rgb(255, 17, 119)'); 18 | }); 19 | 20 | test('glyphicons are available', function(assert) { 21 | assert.expect(1); 22 | this.render(hbs` 23 |
24 | 25 |
26 | `); 27 | return new Ember.RSVP.Promise((resolve, reject) => { 28 | let start = Date.now(); 29 | let interval = setInterval(() => { 30 | if (this.$('span').width() >=40) { 31 | clearInterval(interval); 32 | assert.ok(true); 33 | resolve(); 34 | return; 35 | } 36 | if (Date.now() - start > 500) { 37 | clearInterval(interval); 38 | reject(new Error('Never saw glyphicon font become available')); 39 | } 40 | }, 10); 41 | }); 42 | 43 | }); 44 | 45 | test('only our desired plugins are present', function(assert) { 46 | assert.ok(!Ember.$.fn.scrollspy, "should not have un-selected plugins present"); 47 | assert.ok(Ember.$.fn.collapse, "should have selected plugins present"); 48 | }); 49 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | import { start } from 'ember-cli-qunit'; 6 | 7 | setResolver(resolver); 8 | start(); 9 | --------------------------------------------------------------------------------