diff --git a/.eslintrc.js b/.eslintrc.js index 3e15f15a..ca89bc85 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,5 +23,16 @@ module.exports = { 'no-param-reassign': 'off', 'no-use-before-define': 'off', 'import/prefer-default-export': 'off', + 'no-restricted-globals': [ + 'error', + { + name: 'fit', + message: 'Do not commit focused tests.', + }, + { + name: 'fdescribe', + message: 'Do not commit focused tests.', + }, + ], }, } diff --git a/packages/expect-puppeteer/src/matchers/toFill.test.js b/packages/expect-puppeteer/src/matchers/toFill.test.js index de3aae0c..39c00673 100644 --- a/packages/expect-puppeteer/src/matchers/toFill.test.js +++ b/packages/expect-puppeteer/src/matchers/toFill.test.js @@ -27,7 +27,7 @@ describe('toFill', () => { expect(value).toBe('') }) - fit('should fill textarea', async () => { + it('should fill textarea', async () => { await expect(page).toFill( '[name="notes"]', 'These are \n multiline \n notes', @@ -38,7 +38,7 @@ describe('toFill', () => { expect(value).toBe('These are \n multiline \n notes') }) - fit('should empty the textarea given an empty string', async () => { + it('should empty the textarea given an empty string', async () => { await expect(page).toFill( '[name="notes"]', 'These are \n multiline \n notes', @@ -70,6 +70,16 @@ describe('toFill', () => { ) expect(value).toBe('James') }) + + it('should fill number input', async () => { + const body = await page.$('body') + await expect(body).toFill('[name="age"]', '10') + const value = await page.evaluate( + () => document.querySelector('[name="age"]').value, + ) + expect(value).toBe('10') + }) + it('should fill input with custom delay', async () => { const body = await page.$('body') await expect(body).toFill('[name="firstName"]', 'James', { diff --git a/server/public/index.html b/server/public/index.html index dee63720..f1b1e40f 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -23,6 +23,7 @@