mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-17 16:13:36 +08:00
19 lines
486 B
TypeScript
19 lines
486 B
TypeScript
import { RIframe } from '@/components/RIframe'
|
|
import { mount } from '@vue/test-utils'
|
|
|
|
describe('RIframe loading strategy', () => {
|
|
it.each([
|
|
[true, 'lazy'],
|
|
[false, 'eager'],
|
|
['eager', 'eager'],
|
|
] as const)('sets loading=%s to %s', (lazy, expected) => {
|
|
const wrapper = mount(RIframe, { props: { lazy, src: '/embed.html' } })
|
|
|
|
try {
|
|
expect(wrapper.get('iframe').attributes('loading')).toBe(expected)
|
|
} finally {
|
|
wrapper.unmount()
|
|
}
|
|
})
|
|
})
|