Skip to content

Commit a4c40ff

Browse files
authored
test: make sure page.fill actually clears an input (#851)
1 parent 1b1ed08 commit a4c40ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/page.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,13 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
11321132
await page.fill('input', '').catch(e => error = e);
11331133
expect(error.message).toContain('Cannot type text into input[type=number].');
11341134
});
1135+
it('should be able to clear', async({page, server}) => {
1136+
await page.goto(server.PREFIX + '/input/textarea.html');
1137+
await page.fill('input', 'some value');
1138+
expect(await page.evaluate(() => result)).toBe('some value');
1139+
await page.fill('input', '');
1140+
expect(await page.evaluate(() => result)).toBe('');
1141+
});
11351142
});
11361143

11371144
describe('Page.Events.Close', function() {

0 commit comments

Comments
 (0)