mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* perf: change to import-x * feat: add rules * chore: fix rule * chore: fix * chore: fix * chore: fix * style: `pnpm lint:fix` * Revert "style: `pnpm lint:fix`" This reverts commitdb0116a288. * Revert "chore: fix" This reverts commit69c82a90c0. * chore: fix * style: `pnpm lint:fix` * fix: lint * chore: `pnpm format`
29 lines
963 B
TypeScript
29 lines
963 B
TypeScript
import { mount } from '@vue/test-utils'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { ElButton, ElLoading } from '@element-plus/components'
|
|
import ConfigProvider from '../src/config-provider'
|
|
|
|
import type { LoadingInstance } from '@element-plus/components/loading/src/loading'
|
|
|
|
describe('loading config', () => {
|
|
it('should render loading component', async () => {
|
|
let instance: LoadingInstance
|
|
const startLoading = () => {
|
|
instance = ElLoading.service()
|
|
}
|
|
const wrapper = mount(() => (
|
|
<ConfigProvider namespace="ep" zIndex={10000}>
|
|
<ElButton onClick={startLoading}>test</ElButton>
|
|
</ConfigProvider>
|
|
))
|
|
const btn = wrapper.find('.ep-button')
|
|
btn.trigger('click')
|
|
expect(btn).not.toBeNull()
|
|
const mask = document.querySelector<HTMLElement>('.ep-loading-mask')
|
|
expect(mask).not.toBeNull()
|
|
expect(mask?.style.zIndex).toBe('10001')
|
|
// @ts-expect-error
|
|
instance.close()
|
|
})
|
|
})
|