[FIX] web:tests: do not rely on testUtils.patch in tests
Revision on https://github.com/odoo/odoo/commit/10f43955d81ff3e7b5ab050656b312ec19f927c5 Commit above uses `testUtils.patch` in the test. However, this utility function does not seem to work. That sucks...
This commit is contained in:
@@ -2018,14 +2018,14 @@ QUnit.module('basic_fields', {
|
||||
var done = assert.async();
|
||||
assert.expect(6);
|
||||
|
||||
testUtils.patch(JournalDashboardGraph, {
|
||||
on_attach_callback: function () {
|
||||
assert.step('on_attach_callback');
|
||||
},
|
||||
on_detach_callback: function () {
|
||||
assert.step('on_detach_callback');
|
||||
},
|
||||
});
|
||||
var originalAttachCallback = JournalDashboardGraph.prototype.on_attach_callback;
|
||||
var originalDetachCallback = JournalDashboardGraph.prototype.on_detach_callback;
|
||||
JournalDashboardGraph.prototype.on_attach_callback = function () {
|
||||
assert.step('on_attach_callback');
|
||||
};
|
||||
JournalDashboardGraph.prototype.on_detach_callback = function () {
|
||||
assert.step('on_detach_callback');
|
||||
};
|
||||
|
||||
createAsyncView({
|
||||
View: KanbanView,
|
||||
@@ -2056,7 +2056,8 @@ QUnit.module('basic_fields', {
|
||||
]);
|
||||
|
||||
kanban.destroy();
|
||||
testUtils.unpatch(JournalDashboardGraph);
|
||||
JournalDashboardGraph.prototype.on_attach_callback = originalAttachCallback;
|
||||
JournalDashboardGraph.prototype.on_detach_callback = originalDetachCallback;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user