From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/web/doc/module/27 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 addons/web/doc/module/27 (limited to 'addons/web/doc/module/27') diff --git a/addons/web/doc/module/27 b/addons/web/doc/module/27 new file mode 100644 index 00000000..2061b700 --- /dev/null +++ b/addons/web/doc/module/27 @@ -0,0 +1,28 @@ +Index: web_example/static/src/tests/timer.js +=================================================================== +--- web_example.orig/static/src/tests/timer.js ++++ web_example/static/src/tests/timer.js +@@ -71,4 +71,23 @@ openerp.testing.section('timer', functio + strictEqual($lis[0].textContent, '11:34:36'); + strictEqual($lis[1].textContent, '23:21:32'); + }); ++ test('start', {templates: true, rpc: 'mock', asserts: 3}, function (instance, $fixture, mock) { ++ // Rather odd-looking shortcut for search+read in a single RPC call ++ mock('/web/dataset/search_read', function () { ++ // ignore parameters, just return a pair of records. ++ return {records: [ ++ {time: 22733958}, ++ {time: 84092336} ++ ]}; ++ }); ++ ++ var w = new instance.web_example.Action(); ++ return w.appendTo($fixture) ++ .then(function () { ++ var $lis = $fixture.find('li'); ++ strictEqual($lis.length, 2); ++ strictEqual($lis[0].textContent, '06:18:53'); ++ strictEqual($lis[1].textContent, '23:21:32'); ++ }); ++ }); + }); -- cgit v1.2.3