Skip to content

Commit

Permalink
Merge pull request #1 from Gpx/deploy
Browse files Browse the repository at this point in the history
feat: 🎸 implement userEvent.click
  • Loading branch information
Gpx committed Sep 20, 2018
2 parents e644a81 + 992b1b2 commit 1de4322
Show file tree
Hide file tree
Showing 7 changed files with 13,779 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": ["env", "react"]
}
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
16 changes: 16 additions & 0 deletions .travis.yml
@@ -0,0 +1,16 @@
language: node_js
cache:
directories:
- ~/.npm
notifications:
email: false
node_js:
- '10'
- '9'
- '8'
after_success:
- npm run build
- npm run travis-deploy-once "npm run semantic-release"
branches:
except:
- /^v\d+\.\d+\.\d+$/
27 changes: 27 additions & 0 deletions __tests__/events.js
@@ -0,0 +1,27 @@
import React from 'react'
import { render } from 'react-testing-library'
import 'jest-dom/extend-expect'
import userEvent from '../src'

test('fireEvent.click simulates a user click', () => {
const { getByTestId } = render(
<React.Fragment>
<input data-testid="A" />
<input data-testid="B" />
</React.Fragment>
)

const a = getByTestId('A')
const b = getByTestId('B')

expect(a).not.toHaveFocus()
expect(b).not.toHaveFocus()

userEvent.click(a)
expect(a).toHaveFocus()
expect(b).not.toHaveFocus()

userEvent.click(b)
expect(a).not.toHaveFocus()
expect(a).not.toHaveFocus()
})

0 comments on commit 1de4322

Please sign in to comment.