vanilla 19.0

This commit is contained in:
Ernad Husremovic 2025-10-08 10:49:46 +02:00
parent 991d2234ca
commit d1963a3c3a
3066 changed files with 1651266 additions and 922560 deletions

View file

@ -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();
});

View file

@ -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");
});