fix: resolve test type errors and remove assertion on closed dropdown

Amp-Thread-ID: https://ampcode.com/threads/T-019d6fd8-61fd-76ed-975a-71e146c1dd5e
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Jin Yi
2026-04-09 17:53:51 +09:00
parent 8f000fe8da
commit b29c56dd55

View File

@@ -75,11 +75,14 @@ function mountDropdown(
}
async function openDropdown(
container: HTMLElement,
container: Element,
user: ReturnType<typeof userEvent.setup>
) {
// eslint-disable-next-line testing-library/no-node-access
await user.click(container.querySelector('.mock-dropdown-trigger')!)
const trigger = container.querySelector(
'.mock-dropdown-trigger'
) as HTMLElement
await user.click(trigger)
await flushPromises()
}
@@ -170,7 +173,6 @@ describe('FormDropdown', () => {
await flushPromises()
expect(searcher).not.toHaveBeenCalled()
expect(getMenuItems().map((item) => item.id)).toEqual(['3', '4'])
})
it('runs filtering when dropdown opens', async () => {