jQuery 1.5.1 testing

Antranig Basman antranig.basman at colorado.edu
Tue Mar 22 07:04:34 UTC 2011


Thanks for looking into these issues, John. Currently our implementation of fluid.value() will not pass 
these tests either, since it defers to the base jQuery.val() implementation in the case the node does not 
represent a radio button or a checkbox. However, it will be easy enough to upgrade our implementation of 
fluid.value() so that it adapts over the failings of the jQuery 1.5.1 implementation. Please could you also 
expand your test case coverage so that it deals with radio buttons and checkboxes also.

I'm dubious about your 3rd test case... "" is a value, even though a falsy one, and the behaviour should be 
to operate val() as a setter and hence return the jQuery as per the docs, rather than the test_value as your 
test tests. The only real contract bug in 1.5.1 is the one relating to the handling of "undefined" as far as 
I can see.

I've just "opportunistically" pushed a fix for this issue to Infusion trunk - let me know if this succeeds 
in letting fluid.value() adapt to all manifestations of this issue.

Thanks,
Antranig.

On 21/03/2011 16:41, John Kremer wrote:
> Hey Colin,
>
> Thanks for the details. I will check them out tomorrow when I get in and
> write up and run some more tests to see if that may solve the problem.
>
> John
>
> On Mon, Mar 21, 2011 at 5:51 PM, Colin Clark<colinbdclark at gmail.com>  wrote:
>
>> Hi John,
>>
>> Thanks for the detective work. There's a function in DataBinding.js,
>> fluid.value(), which advertises itself as a "generalization" of
>> jQuery.val(). Does it pass your tests? And if so, do you think fluid.value()
>> is a suitable replacement for jQuery.val() in the places where we're
>> currently seeing regressions?
>>
>> If so, maybe can promote it to the core Fluid.js file and just never use
>> jQuery.val() again.
>>
>> Too bad jQuery broke the contract on val() and filed it "won't fix." :(
>>
>> Colin
>>
>> On 2011-03-21, at 5:27 PM, John Kremer wrote:
>>
>>> Just wrote a few jQuery 1.5.1 tests for .val():
>>>
>>>   var test_value = "abc";
>>>             jqUnit.assertEquals("Testing textbox value", test_value,
>> $("#textbox-with-value").val());
>>>             jqUnit.assertEquals("Testing textbox value", test_value,
>> $("#textbox-with-value").val(undefined));
>>>             jqUnit.assertEquals("Testing textbox value", test_value,
>> $("#textbox-with-value").val(""));
>>>          });
>>>
>>> The only passing test is the top one, and passing a falsy returns the
>> jQuery object as oppose to the value of the object.
>>>
>>> There are many tests that are failing in the migration over to 1.5.1 due
>> to this issue.
>>>
>>> https://github.com/jkkremer/infusion/tree/FLUID-4113
>>>
>> https://github.com/jkkremer/infusion/commit/39a684870854dfe205f8a6589b2c1526aba47697
>>
>>
>> ---
>> Colin Clark
>> Technical Lead, Fluid Project
>> http://fluidproject.org
>>
>>
>
>
>
> _______________________________________________________
> fluid-work mailing list - fluid-work at fluidproject.org
> To unsubscribe, change settings or access archives,
> see http://fluidproject.org/mailman/listinfo/fluid-work




More information about the fluid-work mailing list