test: eliminate interfering logs (#23370)

This commit is contained in:
btea
2026-01-14 06:11:17 +08:00
committed by GitHub
parent 9c5adc9c48
commit a170f52aa1
2 changed files with 8 additions and 3 deletions

View File

@@ -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
/>

View File

@@ -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()
})
})