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

Commit ade548a

Browse files
ayusharmajuanpicado
authored andcommitted
fix: adds no uplink spec (#213)
1 parent 6dfcd70 commit ade548a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/components/UpLinks/UpLinks.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ describe('<UpLinks /> component', () => {
1111
expect(wrapper.html()).toBeNull();
1212
});
1313

14+
test('should render the component when there is no uplink', () => {
15+
const packageMeta = {
16+
latest: {
17+
name: 'verdaccio',
18+
version: '4.0.0',
19+
dist: { fileCount: 0, unpackedSize: 0 },
20+
},
21+
_uplinks: {},
22+
};
23+
24+
const wrapper = mount(
25+
<DetailContext.Provider value={{ packageMeta }}>
26+
<UpLinks />
27+
</DetailContext.Provider>
28+
);
29+
expect(wrapper.html()).toMatchSnapshot();
30+
});
31+
1432
test('should render the component with uplinks', () => {
1533
const packageMeta = {
1634
latest: {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
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>"`;
4+
35
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 commit comments

Comments
 (0)