style: 全站接入深色主题,按新规则整改界面取值
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { flushPromises, mount } from '@vue/test-utils'
|
||||
import { DOMWrapper, flushPromises, mount } from '@vue/test-utils'
|
||||
import ElementPlus from 'element-plus'
|
||||
import MarkerChips from '@/components/MarkerChips.vue'
|
||||
import { listTagCandidates } from '@/api/markers'
|
||||
@@ -63,7 +63,9 @@ describe('MarkerChips 打标签搜索选择(闭环-03)', () => {
|
||||
await flushPromises()
|
||||
|
||||
expect(listTagCandidates).toHaveBeenCalled()
|
||||
expect((wrapper.vm as unknown as { candidates: string[] }).candidates).toEqual(['英语', '数学'])
|
||||
await wrapper.find('[aria-label="新标签名"]').trigger('click'); await flushPromises();
|
||||
const options = Array.from(document.querySelectorAll('.el-select-dropdown__item')).map(node => node.textContent);
|
||||
expect(options).toContain('英语'); expect(options).toContain('数学');
|
||||
|
||||
wrapper.unmount()
|
||||
})
|
||||
@@ -73,9 +75,9 @@ describe('MarkerChips 打标签搜索选择(闭环-03)', () => {
|
||||
|
||||
await wrapper.find('.marker-add-toggle').trigger('click')
|
||||
await flushPromises()
|
||||
const vm = wrapper.vm as unknown as { draft: string }
|
||||
vm.draft = '物理'
|
||||
await flushPromises()
|
||||
await wrapper.find('[aria-label="新标签名"]').setValue('物理'); await flushPromises();
|
||||
const option = Array.from(document.querySelectorAll('.el-select-dropdown__item')).find(node => node.textContent === '物理');
|
||||
await new DOMWrapper(option!).trigger('click'); await flushPromises();
|
||||
|
||||
const confirm = wrapper.find('.marker-add-confirm')
|
||||
await confirm.trigger('click')
|
||||
|
||||
Reference in New Issue
Block a user