diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-06-05 09:18:14 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-06-12 09:47:48 +0000 |
| commit | b4ba0fc34082deec8ca6c871ce7a203c0a3a61a4 (patch) | |
| tree | 27451423f32b218e699d3135c398d338b249c5cd /addons/web/static/tests/views/calendar_tests.js | |
| parent | dc260c324170a90fa737cd21dd528e39d658d9b6 (diff) | |
[FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
Diffstat (limited to 'addons/web/static/tests/views/calendar_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/calendar_tests.js | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js index 7b69e8ce167..ba8c1f35dfd 100644 --- a/addons/web/static/tests/views/calendar_tests.js +++ b/addons/web/static/tests/views/calendar_tests.js @@ -2541,7 +2541,7 @@ QUnit.module('Views', { }); QUnit.test('check if the view destroys all widgets and instances', async function (assert) { - assert.expect(1); + assert.expect(2); var instanceNumber = 0; testUtils.mock.patch(mixins.ParentedMixin, { @@ -2579,21 +2579,10 @@ QUnit.module('Views', { }; var calendar = await createCalendarView(params); - calendar.destroy(); - - var initialInstanceNumber = instanceNumber; - instanceNumber = 0; - - calendar = await createCalendarView(params); - - // call destroy function of controller to ensure that it correctly destroys everything - calendar.__destroy(); - - // + 1 (parent) - assert.strictEqual(instanceNumber, initialInstanceNumber + 1, - "every widget must be destroyed exept the parent"); + assert.ok(instanceNumber > 0); calendar.destroy(); + assert.strictEqual(instanceNumber, 0); testUtils.mock.unpatch(mixins.ParentedMixin); }); |
