mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 09:21:25 +08:00
45 lines
995 B
JavaScript
45 lines
995 B
JavaScript
import { mount } from '@vue/test-utils';
|
|
import ConfigProvider from '..';
|
|
import Button from '../../button';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
|
|
describe('ConfigProvider', () => {
|
|
mountTest({
|
|
render() {
|
|
return (
|
|
<ConfigProvider>
|
|
<div />
|
|
</ConfigProvider>
|
|
);
|
|
},
|
|
});
|
|
|
|
it('Content Security Policy', () => {
|
|
const csp = { nonce: 'test-antd' };
|
|
const wrapper = mount({
|
|
render() {
|
|
return (
|
|
<ConfigProvider csp={csp}>
|
|
<Button />
|
|
</ConfigProvider>
|
|
);
|
|
},
|
|
});
|
|
expect(wrapper.findComponent('Wave').vm.csp).toBe(csp);
|
|
});
|
|
|
|
it('autoInsertSpaceInButton', () => {
|
|
const wrapper = mount({
|
|
render() {
|
|
return (
|
|
<ConfigProvider autoInsertSpaceInButton={false}>
|
|
<Button>确定</Button>
|
|
</ConfigProvider>
|
|
);
|
|
},
|
|
});
|
|
|
|
expect(wrapper.findComponent('AButton').text()).toBe('确定');
|
|
});
|
|
});
|