Files
element-plus/packages/components/watermark/__tests__/watermark.test.tsx
刘臻 7916200ba4 feat(components): watermark component (#14236)
* feat(components): watermark component

be able to set text,multi-text,image as watermark

* docs(components): update image watermark example

update the image for dark mode
2023-10-10 17:42:22 +08:00

23 lines
567 B
TypeScript

import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import Watermark from '../src/watermark.vue'
const AXIOM = 'Rem is the best girl'
describe('Watermark.vue', () => {
it('create', () => {
const wrapper = mount(() => (
<Watermark class="watermark">{AXIOM}</Watermark>
))
expect(wrapper.classes()).toContain('watermark')
expect(wrapper.html()).toMatchSnapshot()
})
it('slots', () => {
const wrapper = mount(() => <Watermark>{AXIOM}</Watermark>)
expect(wrapper.text()).toContain(AXIOM)
})
})