Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
fix: adds no uplink spec (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayusharma authored and juanpicado committed Oct 25, 2019
1 parent 6dfcd70 commit ade548a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/UpLinks/UpLinks.test.tsx
Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap
@@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<UpLinks /> component should render the component when there is no uplink 1`] = `"<h6 class=\\"MuiTypography-root MuiTypography-subtitle1 MuiTypography-gutterBottom\\">verdaccio has no uplinks.</h6>"`;
exports[`<UpLinks /> component should render the component with uplinks 1`] = `"<h6 class=\\"MuiTypography-root css-1vg6q84 e14i1sy10 MuiTypography-subtitle1\\">Uplinks</h6><ul class=\\"MuiList-root MuiList-padding\\"><li class=\\"MuiListItem-root MuiListItem-gutters\\"><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">npmjs</span></div><div class=\\"css-1l1cv61 e14i1sy11\\"></div><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">over 1 year ago</span></div></li></ul>"`;

0 comments on commit ade548a

Please sign in to comment.