diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-05-10 15:43:58 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2017-05-11 12:57:59 +0200 |
| commit | 2e69c189b1c0df1fcb7d31d1d8a52ae55f4c3fc7 (patch) | |
| tree | 7bf499858a0f9bc52dd98d6355ded4e84db5c5e4 /addons/web/static | |
| parent | cc141dcce10e7b470fb6117c3270d4c490c6ba0e (diff) | |
[IMP] web: calendar test: Error message when the screen is too small
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/tests/views/calendar_tests.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js index 7010771e992..b81c1965b32 100644 --- a/addons/web/static/tests/views/calendar_tests.js +++ b/addons/web/static/tests/views/calendar_tests.js @@ -396,7 +396,14 @@ QUnit.module('Views', { var top = calendar.$('.fc-axis:contains(8am)').offset().top + 5; var left = calendar.$('.fc-day:eq(2)').offset().left + 5; - testUtils.triggerPositionalMouseEvent(left, top, "mousedown"); + try { + testUtils.triggerPositionalMouseEvent(left, top, "mousedown"); + } catch (e) { + calendar.destroy(); + $view.remove(); + throw new Error('The test fails to simulate a click in the screen. Your screen is probably too small or your dev tools is open.'); + } + testUtils.triggerPositionalMouseEvent(left, top + 60, "mousemove"); assert.strictEqual(calendar.$('.fc-content .fc-time').text(), "08:00 - 10:00", @@ -497,7 +504,13 @@ QUnit.module('Views', { var top = calendar.$('.fc-axis:contains(8am)').offset().top + 5; var left = calendar.$('.fc-day:eq(2)').offset().left + 5; - testUtils.triggerPositionalMouseEvent(left, top, "mousedown"); + try { + testUtils.triggerPositionalMouseEvent(left, top, "mousedown"); + } catch (e) { + calendar.destroy(); + $view.remove(); + throw new Error('The test fails to simulate a click in the screen. Your screen is probably too small or your dev tools is open.'); + } testUtils.triggerPositionalMouseEvent(left, top + 60, "mousemove"); testUtils.triggerPositionalMouseEvent(left, top + 60, "mouseup"); $('.modal input:first').val('new event').trigger('input'); @@ -593,7 +606,13 @@ QUnit.module('Views', { var pos = calendar.$('.fc-bg td:eq(4)').offset(); - testUtils.triggerPositionalMouseEvent(pos.left+15, pos.top+15, "mousedown"); + try { + testUtils.triggerPositionalMouseEvent(pos.left+15, pos.top+15, "mousedown"); + } catch (e) { + calendar.destroy(); + $view.remove(); + throw new Error('The test fails to simulate a click in the screen. Your screen is probably too small or your dev tools is open.'); + } pos = calendar.$('.fc-bg td:eq(5)').offset(); testUtils.triggerPositionalMouseEvent(pos.left+15, pos.top+15, "mousemove"); testUtils.triggerPositionalMouseEvent(pos.left+15, pos.top+15, "mouseup"); |
