feat: Ensure password inputs are masked when switching type (#1170)

* feat: Ensure password inputs are masked when switching type


Apply formatting changes

use data- attribute


ref: Ensure type is always lowercased


add changeset

* extract into util

* Apply formatting changes
This commit is contained in:
Francesco Novy
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 65ef257d33
commit 271501b7b9
9 changed files with 519 additions and 382 deletions

View File

@@ -281,7 +281,7 @@ describe('record integration tests', function (this: ISuite) {
assertSnapshot(snapshots);
});
it('should mask value attribute with maskInputOptions', async () => {
it('should mask password value attribute with maskInputOptions', async () => {
const page: puppeteer.Page = await browser.newPage();
await page.goto('about:blank');
await page.setContent(
@@ -292,7 +292,12 @@ describe('record integration tests', function (this: ISuite) {
}),
);
await page.type('input[type="password"]', 'secr3t');
await page.type('#password', 'secr3t');
// Change type to text (simulate "show password")
await page.click('#show-password');
await page.type('#password', 'XY');
await page.click('#show-password');
const snapshots = (await page.evaluate(
'window.snapshots',