[Freeipa-devel] [PATCH] 32-47 #2040, #1515 Refactor UI widgets

Adam Young ayoung at redhat.com
Thu Dec 1 16:45:35 UTC 2011


On 12/01/2011 10:02 AM, Petr Vobornik wrote:
> Attaching patch for unit tests.
>
> Couple of widget tests still fail.
>
> They raise couple questions:
>
> 1) Should widget expect that array of values like ['value'] will be 
> always passed to update(values) method or the update method should 
> also work with simple values like 'value'?

The widget tests are higly subjective.  Do not be afraid to change  
them,  especially if the assumptions they are written against have 
changed.  They were written more as a way to exercise the widgets than a 
codification of behavior.

>
> 2) Should widget load its own metadata - based on entity and its name 
> or it is responsibility of field (current implementation)?

Personally, I'd prefer if the Metadata was passed to the constructor,  
as that allows us to compose it in multiple ways.  That will be useful 
in the future.  INfact,  I would prefer it if, instead of the Metatdata 
as a chunk,  we passed the indivual pieces that are required  (pattern 
specifically)  so that how to build the object can differ,  but I wanted 
to hold off on doing anything like this until we had at least one more 
specific project to integrate with.  GO with the most striaght forward 
solution for now.

>
> 3) Should custom dirty checks, or other boolean checks (validate) 
> always return pure boolean value, or is integer also acceptable. Usage 
> of &= or |= operators is producing integer values because it actually 
> means 'foo = foo & bar' not 'foo = foo && bar'

Is there really a difference in Javascript?  I so long as they evaluate 
to true/false, it is probably fine,  but is there the possibility for 
confusion?
>
> Also all jsl warnings are fixed and jsl.conf for tests is added.
>
>
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20111201/a912108e/attachment.htm>


More information about the Freeipa-devel mailing list