mirror of
https://github.com/bringout/oca-ocb-web.git
synced 2026-04-19 04:12:01 +02:00
replace stale web_editor with html_editor and html_builder for 19.0
web_editor was removed in Odoo 19.0 and replaced by html_editor
and html_builder. The old web_editor was incorrectly included in
the 19.0 vanilla import.
🤖 assisted by claude
This commit is contained in:
parent
4b94f0abc5
commit
f866779561
1513 changed files with 396049 additions and 358525 deletions
|
|
@ -0,0 +1,46 @@
|
|||
import { Img } from "@html_builder/core/img";
|
||||
import { ImgGroup } from "@html_builder/core/img_group";
|
||||
import { defineMailModels } from "@mail/../tests/mail_test_helpers";
|
||||
import { expect, test, describe } from "@odoo/hoot";
|
||||
import { animationFrame, Deferred } from "@odoo/hoot-dom";
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
import { mountWithCleanup, patchWithCleanup } from "@web/../tests/web_test_helpers";
|
||||
|
||||
describe.current.tags("desktop");
|
||||
|
||||
defineMailModels(); // meh
|
||||
test("ImgGroup's inner Img components should not be blocked before src load", async () => {
|
||||
const defs = {
|
||||
img1: new Deferred(),
|
||||
img2: new Deferred(),
|
||||
img3: new Deferred(),
|
||||
};
|
||||
patchWithCleanup(Img.prototype, {
|
||||
loadImage() {
|
||||
const def = defs[this.props.class];
|
||||
return Promise.all([super.loadImage(), def]);
|
||||
},
|
||||
});
|
||||
class Container extends Component {
|
||||
static components = { ImgGroup, Img };
|
||||
static template = xml`
|
||||
<ImgGroup>
|
||||
<t t-foreach="Object.keys(defs)" t-as="key" t-key="key">
|
||||
<Img src="''" class="key"/>
|
||||
</t>
|
||||
</ImgGroup>`;
|
||||
static props = {};
|
||||
|
||||
setup() {
|
||||
this.defs = defs;
|
||||
}
|
||||
}
|
||||
await mountWithCleanup(Container);
|
||||
|
||||
for (const key in defs) {
|
||||
expect("img").toHaveCount(0);
|
||||
defs[key].resolve();
|
||||
await animationFrame();
|
||||
}
|
||||
expect("img").toHaveCount(3);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue