~bcsaller/juju-gui/export-ui

« back to all changes in this revision

Viewing changes to test/test_resizing_textarea.js

  • Committer: Brad Crittenden
  • Date: 2013-05-02 21:27:26 UTC
  • mfrom: (644.1.2 ta-ie10)
  • Revision ID: bac@canonical.com-20130502212726-l80ycfatmr1dfv8t
Work-around for IE test failures.

Temporary fix to get test_resizing_textarea working on IE10.

R=gary.poster
CC=
https://codereview.appspot.com/9128044

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
describe('textarea autosize plugin', function() {
12
12
 
13
 
  var Y, test_text, container, textarea, target, target2;
 
13
  var Y, test_text, container, textarea, target, target2, ie_fudge;
14
14
 
15
15
  before(function(done) {
16
16
    Y = YUI(GlobalConfig).use([
29
29
        'tristique nisl eget risus blandit iaculis. Lorem ipsum dolor sit ,',
30
30
        'consectetur adipiscing elit.'].join('');
31
31
 
 
32
      // XXX: BradCrittenden 2013-05-02 bug=1175781: This work-around
 
33
      // is just temporary.  The root cause needs to be found and fixed.
 
34
      ie_fudge = 0;
 
35
      if (Y.UA.ie === 10) {
 
36
        // IE10 Computes sizes wrong.
 
37
        ie_fudge = 6;
 
38
      }
32
39
      done();
33
40
    });
34
41
  });
66
73
   *
67
74
   */
68
75
  function get_height(target) {
69
 
    return clean_size(target.getComputedStyle('height'));
 
76
    return clean_size(target.getComputedStyle('height')) + ie_fudge;
70
77
  }
71
78
 
72
79
  /**
228
235
    });
229
236
 
230
237
    target.show();
231
 
    var current_height = get_height(target);
 
238
    var current_height = get_height(target) - ie_fudge;
232
239
    assert.equal(300, current_height,
233
240
        'The height should start out at 300px per the min_height cfg');
234
241
  });