1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-06-28 05:55:33 +07:00
verdaccio-ui/src/components/UpLinks/UpLinks.test.tsx
Priscila Oliveira ae73772a37 feat(eslint-config): add order rule in import
* refactor: added eslint-plugin-import

* refactor: disable some rules for muiComponents

* fix: fixed import
2019-10-07 22:19:18 +02:00

43 lines
1.0 KiB
TypeScript

import React from 'react';
import { shallow, mount } from 'enzyme';
import { DetailContext } from '../../pages/Version';
import UpLinks from './UpLinks';
describe('<UpLinks /> component', () => {
test('should render the component in default state', () => {
const wrapper = shallow(<UpLinks />);
expect(wrapper.html()).toMatchSnapshot();
});
test('should render the component with uplinks', () => {
const packageMeta = {
latest: {
name: 'verdaccio',
version: '4.0.0',
author: {
name: 'verdaccio user',
url: '',
avatar: 'https://www.gravatar.com/avatar/000000',
},
dist: { fileCount: 0, unpackedSize: 0 },
},
_uplinks: {
npmjs: {
etag: '"W/"252f0a131cedd3ea82dfefd6fa049558""',
fetched: 1529779934081,
},
},
};
const wrapper = mount(
<DetailContext.Provider value={{ packageMeta }}>
<UpLinks />
</DetailContext.Provider>
);
expect(wrapper.html()).toMatchSnapshot();
});
});