bc518174
王天杨
提交两个项目文件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { customRender } from 'test/render';
import { Months } from './Months';
let root: HTMLElement;
test('should use the default class name', () => {
const view = customRender(<Months>foo</Months>, {});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveClass('rdp-months');
});
test('should use a custom class name', () => {
const view = customRender(<Months>foo</Months>, {
classNames: { months: 'foo' }
});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveClass('foo');
});
test('should use a custom style', () => {
const view = customRender(<Months>foo</Months>, {
styles: { months: { color: 'red' } }
});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveStyle({ color: 'red' });
});
|