Accept input attributes in any order in unit tests.

Review Request #9344 — Created Nov. 1, 2017 and submitted

erijo
Djblets
release-0.10.x
4594
8ad0bc3...
djblets
The condition set view tests verified that input tags had the expected
type and name attributes by comparing the generated HTML. But in some
browsers the name attribute appears before the type which failed the
test.

Check the tag name and attributes individually instead.

Unit tests now pass.

Description From Last Updated

Why not just test the attributes directly? e.g. let $input = $value.find('input'); expect($input.parent.prop('tagName')).toBe('span'); expect($input.attr('type')).toBe('text'); expect($input.attr('name')).toBe('my_conditions_value[0]'));

brenniebrennie

This can be const instead of let.

daviddavid
brennie
  1. 
      
  2. Why not just test the attributes directly? e.g.

    let $input = $value.find('input');
    expect($input.parent.prop('tagName')).toBe('span');
    expect($input.attr('type')).toBe('text');
    expect($input.attr('name')).toBe('my_conditions_value[0]'));
    
  3. 
      
erijo
erijo
david
  1. 
      
  2. This can be const instead of let.

  3. 
      
erijo
erijo
  1. 
      
  2. Any more comments on this?
  3. 
      
david
  1. Ship It!
  2. 
      
erijo
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.0.x (8525f39)
Loading...