Skip to content

Commit

Permalink
feat(cascader): refactor done (element-plus#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonaliaChen authored Oct 30, 2020
1 parent 6674633 commit 52ea214
Show file tree
Hide file tree
Showing 35 changed files with 2,661 additions and 32 deletions.
10 changes: 0 additions & 10 deletions packages/__mocks__/lodash.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/__mocks__/lodash/debounce.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = jest.fn(fn => {
fn.cancel = jest.fn()
fn.flush = jest.fn()
return fn
})
6 changes: 6 additions & 0 deletions packages/__mocks__/lodash/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const _ = jest.requireActual('lodash')

_.debounce = require('./debounce')
_.throttle = require('./throttle')

module.exports = _
5 changes: 5 additions & 0 deletions packages/__mocks__/lodash/throttle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = jest.fn(fn => {
fn.cancel = jest.fn()
fn.flush = jest.fn()
return fn
})
3 changes: 3 additions & 0 deletions packages/autocomplete/__tests__/autocomplete.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { mount } from '@vue/test-utils'
import { sleep } from '@element-plus/test-utils'
import { NOOP } from '@vue/shared'

jest.unmock('lodash/debounce')

import Autocomplete from '../src/index.vue'

const _mount = (payload = {}) => mount({
Expand Down
Loading

0 comments on commit 52ea214

Please sign in to comment.