summaryrefslogtreecommitdiff
path: root/addons/website/static/tests
diff options
context:
space:
mode:
authorfja-odoo <fja@odoo.com>2019-06-19 15:28:56 +0000
committerqsm-odoo <qsm@odoo.com>2019-08-08 16:05:33 +0000
commit736353b169d451d48cb9d5ae82c2d342543ba57e (patch)
tree9734e1e729938710074aab8b96a787ac889a9f4e /addons/website/static/tests
parent50155ae08e6e3f4a60bf3142174f56bfd246d865 (diff)
[IMP] website, *: improve published smart button
* = web, website_blog, website_crm_partner_assign, website_event, website_event_track, website_forum, website_hr_recruitment, website_livechat, website_partner, website_profile, website_sale, website_sale_delivery, website_slides The published button name is a bit ambiguous, now it will clearly state what it does with a new title : "Go to Website". The "Published", "Unpublished" state is shown with the globe icon changing color (green and red) and a title on the button. Badge and Delivery don't have a website page, the button will then be a publish/unpublish button in the backend. task-2002435 closes odoo/odoo#34261 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/website/static/tests')
-rw-r--r--addons/website/static/tests/website_tests.js28
1 files changed, 11 insertions, 17 deletions
diff --git a/addons/website/static/tests/website_tests.js b/addons/website/static/tests/website_tests.js
index cd7d14a68a3..8d43100b9d5 100644
--- a/addons/website/static/tests/website_tests.js
+++ b/addons/website/static/tests/website_tests.js
@@ -31,22 +31,19 @@ QUnit.module('website', {
View: FormView,
model: 'blog_post',
data: this.data,
- arch:
- '<form>' +
+ arch: '<form>' +
'<sheet>' +
'<div class="oe_button_box" name="button_box">' +
- '<button class="oe_stat_button" name="website_publish_button" type="object" icon="fa-globe">' +
- '<field name="website_published" widget="website_button"/>' +
- '</button>' +
+ '<field name="website_published" widget="website_redirect_button"/>' +
'</div>' +
'</sheet>' +
'</form>',
res_id: 1,
});
- var selector = '.oe_button_box .oe_stat_button .o_stat_info[name="website_published"] .o_stat_text';
- assert.containsN(form, selector, 2, "there should be two texts displayed");
- selector = '.oe_button_box .oe_stat_button .o_stat_info[name="website_published"] .o_stat_text.o_value.text-danger';
- assert.containsOnce(form, selector, "there should be one text in red");
+ var selector = '.oe_button_box .oe_stat_button[name="website_published"] .o_stat_text';
+ assert.containsN(form, selector, 1, "there should be one text displayed");
+ selector = '.oe_button_box .oe_stat_button[name="website_published"] .o_button_icon.fa-globe.text-danger';
+ assert.containsOnce(form, selector, "there should be one icon in red");
form.destroy();
});
QUnit.test("widget website button: display true value", async function (assert) {
@@ -56,21 +53,18 @@ QUnit.module('website', {
View: FormView,
model: 'blog_post',
data: this.data,
- arch:
- '<form>' +
+ arch: '<form>' +
'<sheet>' +
'<div class="oe_button_box" name="button_box">' +
- '<button class="oe_stat_button" name="website_publish_button" type="object" icon="fa-globe">' +
- '<field name="website_published" widget="website_button"/>' +
- '</button>' +
+ '<field name="website_published" widget="website_redirect_button"/>' +
'</div>' +
'</sheet>' +
'</form>',
res_id: 2,
});
- var selector = '.oe_button_box .oe_stat_button .o_stat_info[name="website_published"] .o_stat_text';
- assert.containsN(form, selector, 2, "should be two texts displayed");
- selector = '.oe_button_box .oe_stat_button .o_stat_info[name="website_published"] .o_stat_text.o_value.text-success';
+ var selector = '.oe_button_box .oe_stat_button[name="website_published"] .o_stat_text';
+ assert.containsN(form, selector, 1, "should be one text displayed");
+ selector = '.oe_button_box .oe_stat_button[name="website_published"] .o_button_icon.fa-globe.text-success';
assert.containsOnce(form, selector, "there should be one text in green");
form.destroy();
});