fix: Fix input.type check (#1184)

* fix: Fix input.type check

Actually I noticed that `el.type` returns `text` when type is not explicitly set, so this is slightly incorrect.

* fix linting

* Apply formatting changes
This commit is contained in:
Francesco Novy
2026-04-01 12:00:00 +08:00
committed by GitHub
parent ea9033fc08
commit 6360042d33
9 changed files with 298 additions and 23 deletions

View File

@@ -455,6 +455,30 @@ describe('record integration tests', function (this: ISuite) {
assertSnapshot(snapshots);
});
it('should not record input values if dynamically added and maskAllInputs is true', async () => {
const page: puppeteer.Page = await browser.newPage();
await page.goto('about:blank');
await page.setContent(
getHtml.call(this, 'empty.html', { maskAllInputs: true }),
);
await page.evaluate(() => {
const el = document.createElement('input');
el.id = 'input';
el.value = 'input should be masked';
const nextElement = document.querySelector('#one')!;
nextElement.parentNode!.insertBefore(el, nextElement);
});
await page.type('#input', 'moo');
const snapshots = (await page.evaluate(
'window.snapshots',
)) as eventWithTime[];
assertSnapshot(snapshots);
});
it('should record webgl canvas mutations', async () => {
const page: puppeteer.Page = await browser.newPage();
await page.goto('about:blank');