File tree Expand file tree Collapse file tree
website_sale_product_assortment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 "website_sale_product_assortment/static/src/js/assortment_list_preview.esm.js" ,
2121 ],
2222 "web.assets_tests" : [
23- "website_sale_product_assortment/static/src/js/no_purchase_tour.js" ,
24- "website_sale_product_assortment/static/src/js/no_restriction_tour.js" ,
25- "website_sale_product_assortment/static/src/js/no_show_tour.js" ,
23+ "website_sale_product_assortment/static/src/js/no_purchase_tour.esm. js" ,
24+ "website_sale_product_assortment/static/src/js/no_restriction_tour.esm. js" ,
25+ "website_sale_product_assortment/static/src/js/no_show_tour.esm. js" ,
2626 ],
2727 },
2828}
Original file line number Diff line number Diff line change 11import { renderToElement } from "@web/core/utils/render" ;
2+ import { rpc } from "@web/core/network/rpc" ;
3+ import publicWidget from "@web/legacy/js/public/public_widget" ;
24
3- var WebsiteSaleProductAssortment = {
5+ publicWidget . registry . WebsiteSaleProductAssortment = publicWidget . Widget . extend ( {
46 selector : "#products_grid" ,
57
68 start : function ( ) {
@@ -16,9 +18,8 @@ var WebsiteSaleProductAssortment = {
1618 product_dic [ this . querySelector ( "a img" ) . src . split ( "/" ) [ 6 ] ] = this ;
1719 } ) ;
1820 const product_ids = Object . keys ( product_dic ) . map ( Number ) ;
19- return this . _rpc ( {
20- route : "/sale/get_info_assortment_preview" ,
21- params : { product_template_ids : product_ids } ,
21+ return rpc ( "/sale/get_info_assortment_preview" , {
22+ product_template_ids : product_ids ,
2223 } ) . then ( ( product_values ) => {
2324 for ( const product of product_values ) {
2425 this . render_product_assortment ( product_dic [ product . id ] , product ) ;
@@ -37,6 +38,4 @@ var WebsiteSaleProductAssortment = {
3738
3839 $ ( product_info ) . find ( ".fa-shopping-cart" ) . parent ( ) . addClass ( "disabled" ) ;
3940 } ,
40- } ;
41-
42- export default WebsiteSaleProductAssortment ;
41+ } ) ;
Original file line number Diff line number Diff line change 1+ /* Copyright 2024 Tecnativa - Carlos Roca
2+ * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
3+
4+ import { registry } from "@web/core/registry" ;
5+
6+ registry . category ( "web_tour.tours" ) . add ( "test_assortment_with_no_purchase" , {
7+ url : "/shop" ,
8+ test : true ,
9+ steps : ( ) => [
10+ {
11+ trigger :
12+ ".oe_product_cart:has(.text-danger:has(.fa-exclamation-triangle)) a:contains('Test Product 1')" ,
13+ run : "click" ,
14+ } ,
15+ {
16+ trigger : ".text-danger:has(.fa-exclamation-triangle)" ,
17+ } ,
18+ {
19+ trigger : "a#add_to_cart.disabled" ,
20+ run : "click" ,
21+ } ,
22+ {
23+ trigger : "span[name='testing']" ,
24+ } ,
25+ {
26+ trigger : "a[href='/shop']" ,
27+ run : "click" ,
28+ } ,
29+ ] ,
30+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /* Copyright 2024 Tecnativa - Carlos Roca
2+ * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
3+
4+ import { registry } from "@web/core/registry" ;
5+
6+ registry . category ( "web_tour.tours" ) . add ( "test_assortment_with_no_restriction" , {
7+ url : "/shop" ,
8+ test : true ,
9+ steps : ( ) => [
10+ {
11+ trigger : "a:contains('Test Product 1')" ,
12+ run : "click" ,
13+ } ,
14+ {
15+ trigger : "a#add_to_cart" ,
16+ run : "click" ,
17+ } ,
18+ {
19+ trigger : "sup.my_cart_quantity:contains('1')" ,
20+ } ,
21+ {
22+ trigger : "a[href='/shop/cart']" ,
23+ run : "click" ,
24+ } ,
25+ {
26+ trigger : "input.js_quantity[value='1']" ,
27+ } ,
28+ {
29+ trigger : "a:contains('Test Product 1')" ,
30+ } ,
31+ ] ,
32+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /* Copyright 2024 Tecnativa - Carlos Roca
2+ * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
3+
4+ import { registry } from "@web/core/registry" ;
5+
6+ registry . category ( "web_tour.tours" ) . add ( "test_assortment_with_no_show" , {
7+ url : "/shop" ,
8+ test : true ,
9+ steps : ( ) => [
10+ {
11+ trigger :
12+ ".o_wsale_product_grid_wrapper:not(:has(a:contains('Test Product 1')))" ,
13+ } ,
14+ {
15+ trigger : "a[href='/shop']" ,
16+ run : "click" ,
17+ } ,
18+ ] ,
19+ } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments