@@ -22,6+22,7 @@ To get started, check out <http://getbootstrap.com>!
* [Community](#community)
* [Versioning](#versioning)
* [Creators](#creators)
+- [Thanks](#thanks)
* [Copyright and license](#copyright-and-license)
@@ -124,6+125,13 @@ For transparency into our release cycle and in striving to maintain backward com
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
<p>Watches the Less source files and automatically recompiles them to CSS whenever you save a change.</p>
<h3><code>grunt test</code> (Run tests)</h3>
- <p>Runs <a href="http://jshint.com">JSHint</a> and runs the <a href="http://qunitjs.com">QUnit</a> tests headlessly in <a href="http://phantomjs.org">PhantomJS</a>.</p>
+ <p>Runs <a href="http://jshint.com">JSHint</a> and runs the <a href="http://qunitjs.com">QUnit</a> tests in real browsers thanks to <a href="https://karma-runner.github.io/2.0/index.html">Karma</a>.</p>
<h3><code>grunt docs</code> (Build & test the docs assets)</h3>
<p>Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via <code>bundle exec jekyll serve</code>.</p>
Bootstrap uses [QUnit](http://api.qunitjs.com/), a powerful, easy-to-use JavaScript unit test framework. Each plugin has a file dedicated to its tests in `unit/<plugin-name>.js`.
* `unit/` contains the unit test files for each Bootstrap plugin.
-* `vendor/` contains third-party testing-related code (QUnit and jQuery).
+* `vendor/` contains jQuery.
* `visual/` contains "visual" tests which are run interactively in real browsers and require manual verification by humans.
-To run the unit test suite via [PhantomJS](http://phantomjs.org/), run `grunt test-js`.
-
-To run the unit test suite via a real web browser, open `index.html` in the browser.
+To run our unit tests on a real web browser [Karma](https://karma-runner.github.io/2.0/index.html), run `grunt test-js` or you can
- assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while preferred over title option')
-
- $tooltip.bootstrapTooltip('hide')
- assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ .one('shown.bs.tooltip', function () {
+ assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while preferred over title option')
+ $(this).bootstrapTooltip('hide')
+ })
+ .one('hidden.bs.tooltip', function () {
+ assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ done()
+ })
+ .bootstrapTooltip('show')
})
QUnit.test('should use title option', function (assert) {
assert.expect(2)
- var $tooltip = $('<a href="#" rel="tooltip"/>')
+ var done = assert.async()
+
+ $('<a href="#" rel="tooltip"/>')
.appendTo('#qunit-fixture')
.bootstrapTooltip({
title: 'This is a tooltip with some content'
})
-
- $tooltip.bootstrapTooltip('show')
- assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'This is a tooltip with some content', 'title from title option is set')
-
- $tooltip.bootstrapTooltip('hide')
- assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ .one('shown.bs.tooltip', function () {
+ assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'This is a tooltip with some content', 'title from title option is set')
+ $(this).bootstrapTooltip('hide')
+ })
+ .one('hidden.bs.tooltip', function () {
+ assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ done()
+ })
+ .bootstrapTooltip('show')
})
QUnit.test('should be placed dynamically to viewport with the dynamic placement option', function (assert) {
+ assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ $styles.remove()
+ done()
+ })
+ .bootstrapTooltip('show')
})
QUnit.test('should display the tip on bottom whenever scrollable viewport doesn\'t have enough room if the given placement is "auto top"', function (assert) {
+ assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ $styles.remove()
+ done()
+ })
+ .bootstrapTooltip('show')
})
QUnit.test('should display the tip on bottom whenever scrollable viewport has enough room if the given placement is "auto bottom"', function (assert) {
+ assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom')
+ $styles.remove()
+ done()
+ })
+ .bootstrapTooltip('show')
})
QUnit.test('should display the tip on top whenever scrollable viewport doesn\'t have enough room if the given placement is "auto bottom"', function (assert) {