Skip to content

Commit

Permalink
Merge pull request #12058 from ZDroid/uti
Browse files Browse the repository at this point in the history
Remove semicolons from JS tests
  • Loading branch information
XhmikosR committed Feb 18, 2014
2 parents dd9e9ce + a06e15d commit 25d047d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 45 deletions.
10 changes: 5 additions & 5 deletions js/tests/unit/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ $(function () {

test('should not fire closed when close is prevented', function () {
$.support.transition = false
stop();
stop()
$('<div class="alert"/>')
.on('close.bs.alert', function (e) {
e.preventDefault();
ok(true);
start();
e.preventDefault()
ok(true)
start()
})
.on('closed.bs.alert', function () {
ok(false);
ok(false)
})
.alert('close')
})
Expand Down
62 changes: 31 additions & 31 deletions js/tests/unit/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ $(function () {
stop()
$('<div class="carousel"/>')
.on('slide.bs.carousel', function (e) {
e.preventDefault();
ok(true);
start();
e.preventDefault()
ok(true)
start()
})
.on('slid.bs.carousel', function () {
ok(false);
ok(false)
})
.carousel('next')
})
Expand All @@ -42,14 +42,14 @@ $(function () {
ok($carousel.find('.item:eq(0)').is('.active'))
ok($carousel.find('.carousel-indicators li:eq(0)').is('.active'))
$carousel.carousel('next')
}, 1);
}, 1)
})
$carousel.one('slid.bs.carousel', function () {
setTimeout(function () {
ok($carousel.find('.item:eq(1)').is('.active'))
ok($carousel.find('.carousel-indicators li:eq(1)').is('.active'))
start()
}, 1);
}, 1)
})
$carousel.carousel('next')
})
Expand All @@ -72,39 +72,39 @@ $(function () {
stop()
$(template)
.on('slide.bs.carousel', function (e) {
e.preventDefault();
ok(e.relatedTarget);
ok($(e.relatedTarget).hasClass('item'));
start();
e.preventDefault()
ok(e.relatedTarget)
ok($(e.relatedTarget).hasClass('item'))
start()
})
.carousel('next')
})

test('should set interval from data attribute', 4, function () {
var template = $('<div id="myCarousel" class="carousel slide"> <div class="carousel-inner"> <div class="item active"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}First Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Second Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Third Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a> </div>');
template.attr('data-interval', 1814);
var template = $('<div id="myCarousel" class="carousel slide"> <div class="carousel-inner"> <div class="item active"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}First Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Second Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Third Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a> </div>')
template.attr('data-interval', 1814)

template.appendTo('body');
$('[data-slide]').first().click();
ok($('#myCarousel').data('bs.carousel').options.interval == 1814);
$('#myCarousel').remove();
template.appendTo('body')
$('[data-slide]').first().click()
ok($('#myCarousel').data('bs.carousel').options.interval == 1814)
$('#myCarousel').remove()

template.appendTo('body').attr('data-modal', 'foobar');
$('[data-slide]').first().click();
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, 'even if there is an data-modal attribute set');
$('#myCarousel').remove();
template.appendTo('body').attr('data-modal', 'foobar')
$('[data-slide]').first().click()
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, 'even if there is an data-modal attribute set')
$('#myCarousel').remove()

template.appendTo('body');
$('[data-slide]').first().click();
$('#myCarousel').attr('data-interval', 1860);
$('[data-slide]').first().click();
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, 'attributes should be read only on intitialization');
$('#myCarousel').remove();
template.appendTo('body')
$('[data-slide]').first().click()
$('#myCarousel').attr('data-interval', 1860)
$('[data-slide]').first().click()
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, 'attributes should be read only on intitialization')
$('#myCarousel').remove()

template.attr('data-interval', false);
template.appendTo('body');
$('#myCarousel').carousel(1);
ok($('#myCarousel').data('bs.carousel').options.interval === false, 'data attribute has higher priority than default options');
$('#myCarousel').remove();
template.attr('data-interval', false)
template.appendTo('body')
$('#myCarousel').carousel(1)
ok($('#myCarousel').data('bs.carousel').options.interval === false, 'data attribute has higher priority than default options')
$('#myCarousel').remove()
})
})
8 changes: 4 additions & 4 deletions js/tests/unit/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ $(function () {
stop()
$('<div class="collapse"/>')
.on('show.bs.collapse', function (e) {
e.preventDefault();
ok(true);
start();
e.preventDefault()
ok(true)
start()
})
.on('shown.bs.collapse', function () {
ok(false);
ok(false)
})
.collapse('show')
})
Expand Down
10 changes: 5 additions & 5 deletions js/tests/unit/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ $(function () {

test('should not fire closed when close is prevented', function () {
$.support.transition = false
stop();
stop()
$('<div class="tab"/>')
.on('show.bs.tab', function (e) {
e.preventDefault();
ok(true);
start();
e.preventDefault()
ok(true)
start()
})
.on('shown.bs.tab', function () {
ok(false);
ok(false)
})
.tab('show')
})
Expand Down

0 comments on commit 25d047d

Please sign in to comment.