mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-16 01:41:15 +08:00
45 lines
997 B
JavaScript
45 lines
997 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.find({ name: 'Wave' }).vm.csp).toBe(csp);
|
||
|
});
|
||
|
|
||
|
it('autoInsertSpaceInButton', () => {
|
||
|
const wrapper = mount({
|
||
|
render() {
|
||
|
return (
|
||
|
<ConfigProvider autoInsertSpaceInButton={false}>
|
||
|
<Button>确定</Button>
|
||
|
</ConfigProvider>
|
||
|
);
|
||
|
},
|
||
|
});
|
||
|
|
||
|
expect(wrapper.find({ name: 'AButton' }).text()).toBe('确定');
|
||
|
});
|
||
|
});
|