From ade548a7dac300fcb22ec1f7b18ee65f412dc925 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 25 Oct 2019 20:21:48 +0200 Subject: [PATCH] fix: adds no uplink spec (#213) --- src/components/UpLinks/UpLinks.test.tsx | 18 ++++++++++++++++++ .../__snapshots__/UpLinks.test.tsx.snap | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/components/UpLinks/UpLinks.test.tsx b/src/components/UpLinks/UpLinks.test.tsx index 4fa246f..92d4f43 100644 --- a/src/components/UpLinks/UpLinks.test.tsx +++ b/src/components/UpLinks/UpLinks.test.tsx @@ -11,6 +11,24 @@ describe(' 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( + + + + ); + expect(wrapper.html()).toMatchSnapshot(); + }); + test('should render the component with uplinks', () => { const packageMeta = { latest: { diff --git a/src/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap b/src/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap index a745fd7..6fbb6b8 100644 --- a/src/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap +++ b/src/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap @@ -1,3 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[` component should render the component when there is no uplink 1`] = `"
verdaccio has no uplinks.
"`; + exports[` component should render the component with uplinks 1`] = `"
Uplinks
  • npmjs
    over 1 year ago
"`;