Skip to content

Commit c272c4e

Browse files
committed
[FIX] website: adapt test_custom_snippet tour
1 parent dc8e702 commit c272c4e

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

addons/html_builder/static/src/plugins/shadow_option_plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ShadowOptionPlugin extends Plugin {
2929
if (editingElement.style["box-shadow"] === "") {
3030
setBoxShadow(editingElement, getDefaultShadow(shadowMode));
3131
} else {
32-
const shadow = getCurrentShadow(editingElement);
32+
const shadow = getCurrentShadow(editingElement);
3333
if (shadowMode === "inset") {
3434
shadow.mode = "inset";
3535
} else {

addons/html_builder/static/src/snippets/snippet_service.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ export class SnippetModel extends Reactive {
278278
view_id: snippet.viewId,
279279
template_key: this.snippetsName,
280280
});
281+
// Reload snippet to have updated name.
282+
this.loadProm = null;
283+
await this.load();
281284
}
282285

283286
setSnippetName(snippetsDocument) {

addons/test_website/static/tests/tours/custom_snippets.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,22 @@ registerWebsitePreviewTour('test_custom_snippet', {
3535
},
3636
{
3737
content: "Save custom snippet",
38-
trigger: ".snippet-option-SnippetSave we-button",
38+
trigger: "div[data-container-title='Banner'] .oe_snippet_save",
3939
run: "click",
4040
},
4141
{
4242
content: "Confirm reload",
43-
trigger: ".modal-dialog button:contains('Save and Reload')",
43+
trigger: ".modal-dialog button:contains('Save')",
44+
run: "click",
45+
},
46+
{
47+
content: "Click on the block tab",
48+
trigger: ".o-snippets-tabs button[data-name='blocks']",
4449
run: "click",
4550
},
4651
{
4752
content: "Click on the Custom category block",
48-
trigger: "#oe_snippets .oe_snippet[name='Custom'].o_we_draggable .oe_snippet_thumbnail",
53+
trigger: "#snippet_groups .o_snippet[name='Custom'].o_draggable .o_snippet_thumbnail:not(.o_we_ongoing_insertion) .o_snippet_thumbnail_area",
4954
run: "click",
5055
},
5156
{
@@ -54,17 +59,17 @@ registerWebsitePreviewTour('test_custom_snippet', {
5459
},
5560
{
5661
content: "Rename custom snippet",
57-
trigger: ":iframe .o_custom_snippet_wrap > .o_custom_snippet_edit > button",
62+
trigger: ":iframe .o_custom_snippet_edit > button",
5863
run: "click",
5964
},
6065
{
6166
content: "Set name",
62-
trigger: ".o_rename_custom_snippet_dialog input[id='customSnippetName']",
67+
trigger: ".modal-dialog:not(.o_inactive_modal body) input[id='inputConfirmation']",
6368
run: "edit Bruce Banner",
6469
},
6570
{
6671
content: "Confirm rename",
67-
trigger: ".o_rename_custom_snippet_dialog footer .btn-primary",
72+
trigger: ".modal-dialog:not(.o_inactive_modal body) footer .btn-primary",
6873
run: "click",
6974
},
7075
{
@@ -82,12 +87,12 @@ registerWebsitePreviewTour('test_custom_snippet', {
8287
},
8388
{
8489
content: "Click on the Custom category block",
85-
trigger: "#oe_snippets .oe_snippet[name='Custom'].o_we_draggable .oe_snippet_thumbnail",
90+
trigger: "#snippet_groups .o_snippet[name='Custom'].o_draggable .o_snippet_thumbnail:not(.o_we_ongoing_insertion) .o_snippet_thumbnail_area",
8691
run: "click",
8792
},
8893
{
8994
content: "Delete custom snippet",
90-
trigger: ":iframe .o_custom_snippet_wrap > .o_custom_snippet_edit > button + button",
95+
trigger: ":iframe .o_custom_snippet_edit > button + button",
9196
run: "click",
9297
},
9398
{

addons/test_website/tests/test_custom_snippet.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import unittest
77

88

9-
# TODO master-mysterious-egg fix error
10-
@unittest.skip("prepare mysterious-egg for merging")
119
@odoo.tests.common.tagged('post_install', '-at_install')
1210
class TestCustomSnippet(odoo.tests.HttpCase):
1311

0 commit comments

Comments
 (0)