1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-20 01:55:56 +07:00

fix: adds no uplink spec (#213)

This commit is contained in:
Ayush Sharma
2019-10-25 20:21:48 +02:00
committed by Juan Picado @jotadeveloper
parent 6dfcd70025
commit ade548a7da
2 changed files with 20 additions and 0 deletions

View File

@@ -11,6 +11,24 @@ describe('<UpLinks /> component', () => {
expect(wrapper.html()).toBeNull();
});
test('should render the component when there is no uplink', () => {
const packageMeta = {
latest: {
name: 'verdaccio',
version: '4.0.0',
dist: { fileCount: 0, unpackedSize: 0 },
},
_uplinks: {},
};
const wrapper = mount(
<DetailContext.Provider value={{ packageMeta }}>
<UpLinks />
</DetailContext.Provider>
);
expect(wrapper.html()).toMatchSnapshot();
});
test('should render the component with uplinks', () => {
const packageMeta = {
latest: {