summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/tests/tours/helpers/SelectionPopupTourMethods.js
blob: bbe4fc2d369f765d3dcd9c26f8c53dd1342bb699 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
odoo.define('point_of_sale.tour.SelectionPopupTourMethods', function (require) {
    'use strict';

    const { createTourMethods } = require('point_of_sale.tour.utils');

    class Do {
        clickItem(name) {
            return [
                {
                    content: `click selection '${name}'`,
                    trigger: `.selection-item:contains("${name}")`,
                },
            ];
        }
    }

    class Check {
        hasSelectionItem(name) {
            return [
                {
                    content: `selection popup has '${name}'`,
                    trigger: `.selection-item:contains("${name}")`,
                    run: () => {},
                },
            ];
        }
        isShown() {
            return [
                {
                    content: 'selection popup is shown',
                    trigger: '.modal-dialog .popup-selection',
                    run: () => {},
                },
            ];
        }
    }

    return createTourMethods('SelectionPopup', Do, Check);
});