Added tests for #3981 - Slider label ID gets overwritten #4449

merged 2 commits into from May 25, 2012


None yet
2 participants

jasondscott commented May 25, 2012

Tests for Issue #3981 and PR #4433


jasondscott commented May 25, 2012

@johnbender can you review?

@johnbender johnbender commented on an outdated diff May 25, 2012

+ test( "labels that have id keep that id", function() {
+ var slider = $("[for=label-id-slider]");
+ equal(slider.attr("id"), "label-id");
+ });
+ test( "labels without an id get an id", function() {
+ var slider = $("[for=empty-string-val-slider]");
+ ok(slider.attr("id"));

johnbender May 25, 2012


A few super minor nitpicks

First the third argument to the assertions is a description which is helpful when addressing a broken test.

equal( "foo", "foo" )


equal( "foo", "foo", "the foos are equal" )

Second, I would check the exact value of the id in the second case.

var slider = $("#empty-string-val-slider"),
    label = $("[for=empty-string-val-slider]");
ok(label.attr("id"), "something" + slider.attr("id"), "the label id matches the slider id" );

Last I think the slider vars are actually the labels right?

Jason Scott Fixed some minor issues with the slider tests
Added messages to tests.
Changed test to check exact value of id instead of existence.
Changed var names to better reflect what they are.

jasondscott merged commit f9f5e34 into jquery:master May 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment