mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
4e54aa8a46
close #14229
28 lines
676 B
JavaScript
28 lines
676 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import ConfigProvider from '..';
|
|
import Button from '../../button';
|
|
|
|
describe('ConfigProvider', () => {
|
|
it('Content Security Policy', () => {
|
|
const csp = { nonce: 'test-antd' };
|
|
const wrapper = mount(
|
|
<ConfigProvider csp={csp}>
|
|
<Button />
|
|
</ConfigProvider>,
|
|
);
|
|
|
|
expect(wrapper.find('Wave').instance().csp).toBe(csp);
|
|
});
|
|
|
|
it('autoInsertSpaceInButton', () => {
|
|
const wrapper = mount(
|
|
<ConfigProvider autoInsertSpaceInButton={false}>
|
|
<Button>确定</Button>
|
|
</ConfigProvider>,
|
|
);
|
|
|
|
expect(wrapper.find('Button').text()).toBe('确定');
|
|
});
|
|
});
|