[FIX] website_links: fix remaining bugs and restore skipped test
This commit is following c78da8a80 that fixed website_links module.
We had to merge it with a skipped test as there was an error only appearing
with Docker (on runbot or on local with Docker).
This commit fix that test error and some other remaining bugs not found during
the first fix:
1. Fix the test error by adding a step to show recently used links. Indeed the
bug was that newest links would return inconsistent order as both 2 links
created during the steps have the same creation date.
On runbot it would click on the wrong link, the one which has 0 clicks.
Then JS would crash (see error bellow).
2. `websiteLinksCharts` JS animation class would execute all the `start`
method code even if there was no `_totalClicks`. JS would then crash as
`beginDate` would not be set correctly. Before the refactoring all that code
would be skipped as surrounded by an if/else condition.
3. BS3 to BS4 broke the nav-tabs layout to switch between 'Newest, Most Clicked
and Recently Used. `mt16` needed to be removed.
Closes #31829
This commit is contained in:
@@ -52,9 +52,13 @@ tour.register('website_links_tour', {
|
||||
},
|
||||
},
|
||||
// 3. Check that counter got incremented and charts are correctly displayed
|
||||
{
|
||||
content: "filter recently used links",
|
||||
trigger: '#filter-recently-used-links',
|
||||
},
|
||||
{
|
||||
content: "visit link stats page",
|
||||
trigger: '#o_website_links_recent_links a:containsExact("Stats"):first()',
|
||||
trigger: '#o_website_links_recent_links a:containsExact("Stats"):first',
|
||||
},
|
||||
{
|
||||
content: "check click number and ensure graphs are initialized",
|
||||
|
||||
@@ -183,6 +183,7 @@ sAnimations.registry.websiteLinksCharts = sAnimations.Class.extend({
|
||||
$('#all_time_charts').prepend(_t("There is no data to show"));
|
||||
$('#last_month_charts').prepend(_t("There is no data to show"));
|
||||
$('#last_week_charts').prepend(_t("There is no data to show"));
|
||||
return;
|
||||
}
|
||||
|
||||
var formattedClicksByDay = {};
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import odoo.tests
|
||||
import unittest
|
||||
|
||||
|
||||
@odoo.tests.common.tagged('post_install', '-at_install')
|
||||
class TestUi(odoo.tests.HttpCase):
|
||||
|
||||
@unittest.skip("Race condition on runbot or on local with Docker. Merging the test skipped for history purpose as the tour has been reviewed.")
|
||||
def test_01_test_ui(self):
|
||||
self.env['link.tracker'].create({
|
||||
'campaign_id': 2,
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</div>
|
||||
|
||||
<h2 class="o_page_header">Your tracked links
|
||||
<small class="float-right d-none d-md-block mt16" id="filters">
|
||||
<small class="float-right d-none d-md-block" id="filters">
|
||||
<ul class="nav nav-tabs nav-tabs-inline graph-tabs" role="tablist">
|
||||
<li class="nav-item"><a aria-controls="filter-newest-links" href="#" class="nav-link active" id="filter-newest-links" role="tab" data-toggle="tab">Newest</a></li>
|
||||
<li class="nav-item"><a aria-controls="filter-most-clicked-links" href="#" class="nav-link" id="filter-most-clicked-links" role="tab" data-toggle="tab">Most Clicked</a></li>
|
||||
|
||||
Reference in New Issue
Block a user