diff --git a/src/webui/src/components/Package/index.js b/src/webui/src/components/Package/index.js
index 630695058..7e4c33d1e 100644
--- a/src/webui/src/components/Package/index.js
+++ b/src/webui/src/components/Package/index.js
@@ -35,13 +35,9 @@ export default class Package extends React.Component {
}
renderPublished(pkg) {
- if (pkg.time) {
return (
- {`Published ${formatDateDistance(pkg.time)} ago`}
+ {pkg.time ? `Published ${formatDateDistance(pkg.time)} ago`: ''}
);
- }
-
- return null;
}
renderLicense(pkg) {
diff --git a/test/webui/components/__snapshots__/packagelist.spec.js.snap b/test/webui/components/__snapshots__/packagelist.spec.js.snap
index 739a622bc..0683c8723 100644
--- a/test/webui/components/__snapshots__/packagelist.spec.js.snap
+++ b/test/webui/components/__snapshots__/packagelist.spec.js.snap
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[` component should load the component with packages 1`] = `""`;
+exports[` component should load the component with packages 1`] = `""`;
diff --git a/test/webui/components/packagelist.spec.js b/test/webui/components/packagelist.spec.js
index 5d50baae5..f53c61ed5 100644
--- a/test/webui/components/packagelist.spec.js
+++ b/test/webui/components/packagelist.spec.js
@@ -32,12 +32,14 @@ describe(' component', () => {
{
name: 'verdaccio',
version: '1.0.0',
+ time: new Date(),
description: 'Private NPM repository',
author: { name: 'Sam' }
},
{
name: 'abc',
version: '1.0.1',
+ time: new Date(),
description: 'abc description',
author: { name: 'Rose' }
},