Skip to content

Commit 46dd799

Browse files
committed
A more complete autocomplete test
1 parent 6c0aa41 commit 46dd799

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
: process.env.STORYBOOK
2828
? []
2929
: [
30-
// theme-preval is commonjs and needs to be transformed to esm
30+
'transform-commonjs' // theme-preval is commonjs and needs to be transformed to esm
3131
]),
3232
...sharedPlugins,
3333
replacementPlugin('development')

src/stories/Autocomplete.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ export const SingleSelect = () => {
8585

8686
SingleSelect.play = async ({canvasElement}: {canvasElement: HTMLElement}) => {
8787
const canvas = within(canvasElement)
88-
8988
const inputBox = await canvas.getByTestId('autocompleteInput')
9089
await userEvent.click(inputBox)
9190
const firstAutoCompleteOption = canvas.getByText('css')
9291
await expect(firstAutoCompleteOption).toBeInTheDocument()
92+
await userEvent.type(firstAutoCompleteOption, '{enter}')
93+
await expect(inputBox).toHaveValue('css')
9394
}
9495

9596
export const MultiSelect = () => {

0 commit comments

Comments
 (0)