-
Notifications
You must be signed in to change notification settings - Fork 117
[IMP] html_builder: Tests for NavbarLinkPopover and MenuDataPlugin #4602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] html_builder: Tests for NavbarLinkPopover and MenuDataPlugin #4602
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
0231f05
to
0b6ae9c
Compare
0b6ae9c
to
5934928
Compare
</ul> | ||
<p>Outside</p>` | ||
); | ||
await waitFor(".o-we-linkpopover", { timeout: 1500 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You always need this long timeout ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it can be completely removed if needed
setContent( | ||
el, | ||
`<ul class="top_menu"> | ||
<li> | ||
<a class="nav-link" href="exists"> | ||
<span>Top Me[]nu Item</span> | ||
</a> | ||
</li> | ||
</ul> | ||
<p>Outside</p>` | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to set the selection is to use setSelection.
const anchorNode = el.querySelector(".nav-link > span)
setSelection({ anchorNode, anchorOffset: 4})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just need less code
@@ -0,0 +1,273 @@ | |||
import { describe, expect, test } from "@odoo/hoot"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move your file in tests/website_builder/
|
||
defineWebsiteModels(); | ||
|
||
describe("Top Menu should open a NavbarLinkPopover", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NavbarLinkPopover
}); | ||
}); | ||
|
||
describe("should open dialogs when editing link or menu", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use the name of the component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MenuDialog
}; | ||
}, | ||
}; | ||
mockService("orm", fakeORMService); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it s not enough to just mock the RPC ? (onRpc)
5934928
to
bb21851
Compare
No description provided.