mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(tokens): remove tokens * Remove tokens/breadcrumb. * refactor(tokens): remove tokens/button * refactor(tokens): remove tokens/carousel * refactor(tokens): removing tokens/checkbox * refactor(tokens): removing tokens/collapse * refactor(tokens): removing tokens/dialog * refactor(tokens): removing tokens/pagination * refactor(tokens): removing tokens/radio * refactor(tokens): removing tokens/row * refactor(tokens): removing tokens/scrollbar * refactor(tokens): removing tokens/slider * refactor(tokens): removing tokens/tabs * refactor(tokens): removing tokens/upload * refactor(tokens): removing tokens/popper * refactor(tokens): removing tokens/tooltip * refactor(tokens): removing tokens/tooltip-v2 * refactor(tokens): removing tokens/date-picker * refactor(project): removing tokens/experimentals * Remove tokens/experimentals * Remove package/tokens * Remove tokens related parts * refactor(project): removing packages/tokens completely * chore: update import statement
30 lines
804 B
TypeScript
30 lines
804 B
TypeScript
import { defineComponent, inject, nextTick } from 'vue'
|
|
import { mount } from '@vue/test-utils'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { POPPER_INJECTION_KEY } from '@element-plus/components/popper'
|
|
import ElPopper from '../src/popper.vue'
|
|
|
|
const AXIOM = 'rem is the best girl'
|
|
|
|
const TestChild = defineComponent({
|
|
setup() {
|
|
const { contentRef } = inject(POPPER_INJECTION_KEY, undefined)!
|
|
return () => <div ref={contentRef}>{AXIOM}</div>
|
|
},
|
|
})
|
|
|
|
describe('<ElPopper />', () => {
|
|
it('should be able to provide instance to its children', async () => {
|
|
const wrapper = mount(
|
|
<ElPopper>
|
|
<TestChild />
|
|
</ElPopper>
|
|
)
|
|
|
|
await nextTick()
|
|
|
|
expect(wrapper.vm.contentRef).not.toBe(null)
|
|
expect(wrapper.vm.contentRef!.innerHTML).toBe(AXIOM)
|
|
})
|
|
})
|