mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 10:52:02 +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,28 @@
|
|||
import { startInteractions, setupInteractionWhiteList } from "@web/../tests/public/helpers";
|
||||
import { describe, expect, test } from "@odoo/hoot";
|
||||
import { keyDown, queryOne, pointerDown } from "@odoo/hoot-dom";
|
||||
|
||||
setupInteractionWhiteList("web.caps_lock_warning");
|
||||
|
||||
describe.current.tags("interaction_dev");
|
||||
|
||||
const template = `
|
||||
<div class="mb-3 field-password pt-2 o_caps_lock_warning">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<div class="input-group mb-1">
|
||||
<input type="password" name="password" id="password"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
test("caps_lock_warning is started when there is a presence of password input field inside `.o_caps_lock_warning`", async () => {
|
||||
const { core } = await startInteractions(template);
|
||||
expect(core.interactions).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("caps lock alert is displayed when CapsLock is turned on", async () => {
|
||||
await startInteractions(template);
|
||||
await pointerDown(queryOne("#password"));
|
||||
await keyDown("CapsLock");
|
||||
expect(".o_caps_lock_warning_text").toBeVisible();
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import { startInteractions, setupInteractionWhiteList } from "@web/../tests/public/helpers";
|
||||
import { describe, expect, test } from "@odoo/hoot";
|
||||
import { click, queryOne } from "@odoo/hoot-dom";
|
||||
|
||||
setupInteractionWhiteList("web.show_password");
|
||||
|
||||
describe.current.tags("interaction_dev");
|
||||
|
||||
const template = `
|
||||
<div class="input-group">
|
||||
<input type="password" id="password" class="form-control" required="required" name="visibility_password" />
|
||||
<button class="btn border border-start-0 o_show_password" type="button">
|
||||
<i class="fa fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
test("show_password is started when there is a .o_show_password", async () => {
|
||||
const { core } = await startInteractions(template);
|
||||
expect(core.interactions).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("input type changes on clicking the eye icon", async () => {
|
||||
await startInteractions(template);
|
||||
const showEl = queryOne(".o_show_password");
|
||||
expect("input").toHaveAttribute("type", "password");
|
||||
await click(showEl);
|
||||
expect("input").toHaveAttribute("type", "text");
|
||||
await click(showEl);
|
||||
expect("input").toHaveAttribute("type", "password");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue