diff options
| author | Xavier Dubuc <xdu@odoo.com> | 2020-08-18 12:24:10 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-08-21 12:57:44 +0000 |
| commit | 0263acee7f355e7367686a461c21f28ea34cfa9a (patch) | |
| tree | 5f445f8b559c46263d438442b505f629d9545015 /addons/web/static/tests/helpers | |
| parent | f25b730b2f548616d62cf8f30907103116e8c0fd (diff) | |
[FIX] mail: prevent composer to send message if pending uploads
task-2317862
closes odoo/odoo#56303
X-original-commit: 3b5cd048f1dfa18869e95b173b4232b4bb189025
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/web/static/tests/helpers')
| -rw-r--r-- | addons/web/static/tests/helpers/test_utils_mock.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/addons/web/static/tests/helpers/test_utils_mock.js b/addons/web/static/tests/helpers/test_utils_mock.js index 06f9ce33d8a..962b9610f4b 100644 --- a/addons/web/static/tests/helpers/test_utils_mock.js +++ b/addons/web/static/tests/helpers/test_utils_mock.js @@ -333,6 +333,7 @@ function removeSrcAttribute(el, rpc) { * @param {string} [params.currentDate] * @param {Object} [params.data] * @param {boolean} [params.debug] + * @param {function} [params.mockFetch] * @param {function} [params.mockRPC] * @param {number} [params.fieldDebounce=0] the value of the DEBOUNCE attribute * of fields @@ -351,8 +352,11 @@ async function addMockEnvironmentOwl(Component, params, mockServer) { // instantiate a mockServer if not provided if (!mockServer) { let Server = MockServer; + if (params.mockFetch) { + Server = MockServer.extend({ _performFetch: params.mockFetch }); + } if (params.mockRPC) { - Server = MockServer.extend({ _performRpc: params.mockRPC }); + Server = Server.extend({ _performRpc: params.mockRPC }); } mockServer = new Server(params.data, { actions: params.actions, @@ -466,6 +470,9 @@ async function addMockEnvironmentOwl(Component, params, mockServer) { * @param {number} [params.debug] if set to true, logs RPCs and uncaught Odoo * events. * @param {Object} [params.bus] the instance of Bus that will be used (in the env) + * @param {function} [params.mockFetch] a function that will be used to override + * the _performFetch method from the mock server. It is really useful to add + * some custom fetch mocks, or to check some assertions. * @param {function} [params.mockRPC] a function that will be used to override * the _performRpc method from the mock server. It is really useful to add * some custom rpc mocks, or to check some assertions. @@ -506,8 +513,11 @@ async function addMockEnvironment(widget, params) { // instantiate mock server var Server = MockServer; + if (params.mockFetch) { + Server = MockServer.extend({ _performFetch: params.mockFetch }); + } if (params.mockRPC) { - Server = MockServer.extend({ _performRpc: params.mockRPC }); + Server = Server.extend({ _performRpc: params.mockRPC }); } var mockServer = new Server(params.data, { actions: params.actions, |
