summaryrefslogtreecommitdiff
path: root/addons/project
diff options
context:
space:
mode:
Diffstat (limited to 'addons/project')
-rw-r--r--addons/project/static/tests/project_tests.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/addons/project/static/tests/project_tests.js b/addons/project/static/tests/project_tests.js
index 35b41e93e9d..1e33ff2d15d 100644
--- a/addons/project/static/tests/project_tests.js
+++ b/addons/project/static/tests/project_tests.js
@@ -113,18 +113,24 @@ QUnit.module('project', {
return this._super(route, args);
},
});
- assert.strictEqual(kanban.$('img').length, 0, "Initially there is no image.");
- kanban.$('.o_dropdown_kanban [data-type=set_cover]').eq(0).click();
- // single click on image
- $('.modal').find("img[data-id='1']").click();
- $('.modal-footer .btn-primary').click();
- assert.strictEqual(kanban.$('img[data-src*="/web/image/1"]').length, 1, "Image inserted in record");
- $('.o_dropdown_kanban [data-type=set_cover]').eq(1).click();
+
+ testUtils.dom.click(kanban.$('.o_dropdown_kanban:first > a.dropdown-toggle'));
+ testUtils.dom.click(kanban.$('.o_dropdown_kanban:first [data-type=set_cover]'));
+ assert.containsNone(kanban, 'img', "Initially there is no image.");
+ // single click on image, and confirm
+ testUtils.dom.click($('.modal').find("img[data-id='1']"));
+ testUtils.dom.click($('.modal-footer .btn-primary'));
+ assert.containsOnce(kanban, 'img[data-src*="/web/image/1"]');
+
+ testUtils.dom.click(kanban.$('.o_dropdown_kanban:nth(1) > a.dropdown-toggle'));
+ testUtils.dom.click(kanban.$('.o_dropdown_kanban:nth(1) [data-type=set_cover]'));
// double click on image
$('.modal').find("img[data-id='2']").dblclick();
- assert.strictEqual(kanban.$('img[data-src*="/web/image/2"]').length, 1, "Image inserted after double click");
- // varify write on both kanban record
- assert.verifySteps([1,2]);
+ assert.containsOnce(kanban, 'img[data-src*="/web/image/2"]');
+
+ // verify writes on both kanban records
+ assert.verifySteps([1, 2]);
+
kanban.destroy();
});
});