mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-13 08:32:26 +03:00
build(vite): replace webpack with Vite, add Typescript (#1594)
BREAKING: mixins are no longer exported from the index (and will likely be converted to hooks)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { DOMWrapper } from '@vue/test-utils'
|
||||
import typeAheadPointer from '../../src/mixins/typeAheadPointer'
|
||||
import { mountDefault } from '../helpers'
|
||||
import { it, describe, expect, vi, afterEach } from 'vitest'
|
||||
import typeAheadPointer from '@/mixins/typeAheadPointer.js'
|
||||
import { mountDefault } from '@tests/helpers.js'
|
||||
|
||||
describe('Custom Keydown Handlers', () => {
|
||||
let spy
|
||||
@@ -9,7 +9,7 @@ describe('Custom Keydown Handlers', () => {
|
||||
})
|
||||
|
||||
it('can use the map-keydown prop to trigger custom behaviour', async () => {
|
||||
const onKeyDown = jest.fn()
|
||||
const onKeyDown = vi.fn()
|
||||
const Select = mountDefault({
|
||||
mapKeydown: (defaults, vm) => ({ ...defaults, 32: onKeyDown }),
|
||||
})
|
||||
@@ -20,7 +20,7 @@ describe('Custom Keydown Handlers', () => {
|
||||
})
|
||||
|
||||
it('selectOnKeyCodes should trigger a selection for custom keycodes', () => {
|
||||
spy = jest.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
spy = vi.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
|
||||
const Select = mountDefault({
|
||||
selectOnKeyCodes: [32],
|
||||
@@ -32,9 +32,9 @@ describe('Custom Keydown Handlers', () => {
|
||||
})
|
||||
|
||||
it('even works when combining selectOnKeyCodes with map-keydown', () => {
|
||||
spy = jest.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
spy = vi.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
|
||||
const onKeyDown = jest.fn()
|
||||
const onKeyDown = vi.fn()
|
||||
const Select = mountDefault({
|
||||
mapKeydown: (defaults, vm) => ({ ...defaults, 32: onKeyDown }),
|
||||
selectOnKeyCodes: [9],
|
||||
@@ -49,7 +49,7 @@ describe('Custom Keydown Handlers', () => {
|
||||
|
||||
describe('CompositionEvent support', () => {
|
||||
it('will not select a value with enter if the user is composing', () => {
|
||||
spy = jest.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
spy = vi.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
|
||||
const Select = mountDefault()
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('Custom Keydown Handlers', () => {
|
||||
})
|
||||
|
||||
it('will not select a value with tab if the user is composing', () => {
|
||||
spy = jest.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
spy = vi.spyOn(typeAheadPointer.methods, 'typeAheadSelect')
|
||||
|
||||
const Select = mountDefault({ selectOnTab: true })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user