diff --git a/addons/web/static/tests/legacy/core/popover_tests.js b/addons/web/static/tests/legacy/core/popover_tests.js index 4b5002d3350..c94837e3bc2 100644 --- a/addons/web/static/tests/legacy/core/popover_tests.js +++ b/addons/web/static/tests/legacy/core/popover_tests.js @@ -4,6 +4,7 @@ odoo.define('web.popover_tests', function (require) { const makeTestEnvironment = require('web.test_env'); const Popover = require('web.Popover'); const testUtils = require('web.test_utils'); + const { useEffect } = require("@web/core/utils/hooks"); const { Component, tags, hooks } = owl; const { useRef, useState } = hooks; @@ -19,29 +20,31 @@ odoo.define('web.popover_tests', function (require) { SubComponent.template = xml`
`; + let popoverElement; class Parent extends Component { - constructor() { - super(...arguments); + setup() { this.state = useState({ position: 'right', title: '👋', textContent: 'sup', }); - this.popoverRef = useRef('popoverRef'); + const root = useRef("root"); + useEffect(() => { + popoverElement = root.el.children[1]; + }); } } // Popover should be included as a globally available Component Parent.components = { SubComponent }; Parent.env = makeTestEnvironment(); Parent.template = xml` -