General cleaning of some helpers and generic files. The idea is that they are less likely to be entirely re-written in the near future so this is a way to keep the code clean, readable and compliant to the current standards. Changes include: - Use of async/await when possible - Use of const/let instead of var - Removal of underscore.js - Use of native JS instead of jQuery when possible The logic of the affected code remains the same.
27 lines
752 B
JavaScript
27 lines
752 B
JavaScript
odoo.define('web.test_utils_modal', function (require) {
|
|
"use strict";
|
|
|
|
/**
|
|
* Modal Test Utils
|
|
*
|
|
* This module defines various utility functions to help test pivot views.
|
|
*
|
|
* Note that all methods defined in this module are exported in the main
|
|
* testUtils file.
|
|
*/
|
|
|
|
const { _t } = require('web.core');
|
|
const testUtilsDom = require('web.test_utils_dom');
|
|
|
|
/**
|
|
* Click on a button in the footer of a modal (which contains a given string).
|
|
*
|
|
* @param {string} text (in english: this method will perform the translation)
|
|
*/
|
|
function clickButton(text) {
|
|
return testUtilsDom.click($(`.modal-footer button:contains(${_t(text)})`));
|
|
}
|
|
|
|
return { clickButton };
|
|
});
|