chore: type welcome (#10317)

This commit is contained in:
Erik Ritter
2020-07-15 08:38:43 -07:00
committed by GitHub
parent b4cd57b7bd
commit 66b0239eca
17 changed files with 158 additions and 57 deletions

View File

@@ -55,7 +55,7 @@ describe('DashboardTable', () => {
expect(fetchMock.calls(dashboardsEndpoint)).toHaveLength(1);
// there's a delay between response and updating state, so manually set it
// rather than adding a timeout which could introduce flakiness
wrapper.setState({ dashaboards: mockDashboards });
wrapper.setState({ dashboards: mockDashboards });
expect(wrapper.find(ListView)).toHaveLength(1);
done();
});

View File

@@ -23,11 +23,21 @@ import { shallow } from 'enzyme';
import Welcome from 'src/welcome/Welcome';
describe('Welcome', () => {
const mockedProps = {};
const mockedProps = {
user: {
username: 'alpha',
firstName: 'alpha',
lastName: 'alpha',
createdOn: '2016-11-11T12:34:17',
userId: 5,
email: 'alpha@alpha.com',
isActive: true,
},
};
it('is valid', () => {
expect(React.isValidElement(<Welcome {...mockedProps} />)).toBe(true);
});
it('renders 4 Tab, Panel, and Row components', () => {
it('renders 3 Tab, Panel, and Row components', () => {
const wrapper = shallow(<Welcome {...mockedProps} />);
expect(wrapper.find(Tab)).toHaveLength(3);
expect(wrapper.find(Panel)).toHaveLength(3);