mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
test: eliminate interfering logs (#23370)
This commit is contained in:
@@ -1162,7 +1162,7 @@ describe('Datetimerange', () => {
|
||||
it('should show clear btn on focus', async () => {
|
||||
const wrapper = _mount(() => (
|
||||
<DatePicker
|
||||
type="datetimerange"
|
||||
type="datetime"
|
||||
modelValue={new Date(2016, 9, 10, 18, 40)}
|
||||
clearable
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineComponent, nextTick } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { afterEach, describe, it } from 'vitest'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import Options from '../src/options'
|
||||
import Select from '../src/select.vue'
|
||||
|
||||
@@ -57,15 +57,18 @@ describe('options', () => {
|
||||
})
|
||||
|
||||
it('renders emit correct options', async () => {
|
||||
const mockWarn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
createWrapper({
|
||||
default: () =>
|
||||
samples.map((_, i) => <ElOptionStub label={getLabel(i)} />),
|
||||
})
|
||||
|
||||
expect(mockWarn).toHaveBeenCalled()
|
||||
vi.resetAllMocks()
|
||||
await nextTick()
|
||||
})
|
||||
|
||||
it('renders emit correct options with option group', async () => {
|
||||
const spy = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
createWrapper({
|
||||
default: () =>
|
||||
samples.map((_, i) => (
|
||||
@@ -82,5 +85,7 @@ describe('options', () => {
|
||||
</ElOptionGroupStub>
|
||||
)),
|
||||
})
|
||||
expect(spy).toHaveBeenCalled()
|
||||
vi.resetAllMocks()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user