Skip to content

feat(browser): implement several userEvent methods, add fill and dragAndDrop events#5882

Merged
sheremet-va merged 28 commits intovitest-dev:mainfrom
sheremet-va:feat/support-user-event
Jun 18, 2024
Merged

feat(browser): implement several userEvent methods, add fill and dragAndDrop events#5882
sheremet-va merged 28 commits intovitest-dev:mainfrom
sheremet-va:feat/support-user-event

Conversation

@sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jun 13, 2024

Description

Related: #5770

Decided to implement the most frequently used userEvent methods. Click we already implemented.

This PR implements several user event methods:

This PR also adds a new method fill that will clear the input and type new characters (it doesn't support userEvent syntax and because of that it's faster):

await userEvent.type(nameInput, 'Vladimir') // input.value -> 'Vladimir'
await userEvent.type(nameInput, ' Sheremet') // input.value -> 'Vladimir Sheremet'

await userEvent.fill(nameInput, 'Vladimir')  // input.value -> 'Vladimir'

TODO:

  • tests
  • docs

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

@sheremet-va sheremet-va changed the title feat: implement some userEvent methods: type/clear, add fill event feat: implement some userEvent methods: type/clear, add fill event Jun 13, 2024
@sheremet-va sheremet-va changed the title feat: implement some userEvent methods: type/clear, add fill event feat: implement some userEvent methods: type/clear/tab, add fill event Jun 13, 2024
@sheremet-va sheremet-va changed the title feat: implement some userEvent methods: type/clear/tab, add fill event feat: implement some userEvent methods: type/clear/tab/keyboard, add fill event Jun 13, 2024
@sheremet-va sheremet-va changed the title feat: implement some userEvent methods: type/clear/tab/keyboard, add fill event feat: implement several userEvent methods: type/clear/tab/keyboard, add fill event Jun 13, 2024
@sheremet-va sheremet-va marked this pull request as draft June 13, 2024 17:36
@sheremet-va sheremet-va changed the title feat: implement several userEvent methods: type/clear/tab/keyboard, add fill event feat: implement several userEvent methods, add fill event Jun 13, 2024
@sheremet-va sheremet-va force-pushed the feat/support-user-event branch from b45d3a2 to d017746 Compare June 16, 2024 17:28
@sheremet-va sheremet-va force-pushed the feat/support-user-event branch from 114f770 to 9f3052a Compare June 17, 2024 15:14
@sheremet-va sheremet-va changed the title feat: implement several userEvent methods, add fill event feat: implement several userEvent methods, add fill and dragAndDrop events Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant