You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
595 B

import test from 'ava';
9 years ago
import React from 'react';
import { shallow } from 'enzyme';
import Button from '../components/button/button';
9 years ago
let buttonNode;
9 years ago
test.beforeEach(() => {
buttonNode = shallow(<Button>Follow</Button>);
});
9 years ago
test('should set the type to button by default', (t) => {
t.is(buttonNode.type(), 'button');
});
9 years ago
test('should set the default className to button', (t) => {
t.true(buttonNode.hasClass('ant-btn'));
});
test('should has a whitespace in two Chinese charactor', (t) => {
buttonNode = shallow(<Button>按钮</Button>);
t.is(buttonNode.text(), '按 钮');
9 years ago
});