mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 23:32:01 +02:00
vanilla 19.0
This commit is contained in:
parent
991d2234ca
commit
d1963a3c3a
3066 changed files with 1651266 additions and 922560 deletions
|
|
@ -0,0 +1,24 @@
|
|||
import { setupInteractionWhiteList, startInteractions } from "@web/../tests/public/helpers";
|
||||
|
||||
import { describe, expect, test } from "@odoo/hoot";
|
||||
import { queryOne } from "@odoo/hoot-dom";
|
||||
|
||||
setupInteractionWhiteList("public.login");
|
||||
|
||||
describe.current.tags("interaction_dev");
|
||||
|
||||
test("add and remove loading effect", async () => {
|
||||
const { core } = await startInteractions(`
|
||||
<div class="oe_login_form">
|
||||
<button type="submit">log in</button>
|
||||
</div>`);
|
||||
expect(core.interactions).toHaveLength(1);
|
||||
// Not using manuallyDispatchProgrammaticEvent to keep a minimalist test. We
|
||||
// don't need to send a proper "submit" event with FormData, method, action,
|
||||
// etc. for this test.
|
||||
const ev = new Event("submit");
|
||||
queryOne(".oe_login_form").dispatchEvent(ev);
|
||||
expect("button").toHaveClass(["o_btn_loading", "disabled"]);
|
||||
ev.preventDefault();
|
||||
expect("button").not.toHaveClass(["o_btn_loading", "disabled"]);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue