test: make sure page.fill actually clears an input (#851)

This commit is contained in:
Andrey Lushnikov 2020-02-05 16:07:25 -08:00 committed by GitHub
parent 1b1ed087ae
commit a4c40fff82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1132,6 +1132,13 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
await page.fill('input', '').catch(e => error = e);
expect(error.message).toContain('Cannot type text into input[type=number].');
});
it('should be able to clear', async({page, server}) => {
await page.goto(server.PREFIX + '/input/textarea.html');
await page.fill('input', 'some value');
expect(await page.evaluate(() => result)).toBe('some value');
await page.fill('input', '');
expect(await page.evaluate(() => result)).toBe('');
});
});
describe('Page.Events.Close', function() {