\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n||
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n
\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n\n \n \n \n | \n||
{`error: ${error}`}
+{`info: ${JSON.stringify(info)}`}
+ > + ); + } + return children; + } +} diff --git a/src/components/ActionBar/ActionBar.test.tsx b/src/components/ActionBar/ActionBar.test.tsx index e227f45..fac80e0 100644 --- a/src/components/ActionBar/ActionBar.test.tsx +++ b/src/components/ActionBar/ActionBar.test.tsx @@ -1,69 +1,58 @@ import React from 'react'; -import { mount, shallow } from 'enzyme'; +import { mount } from 'enzyme'; +import { ActionBar } from './ActionBar'; + +const mockPackageMeta = jest.fn(() => ({ + latest: { + homepage: 'https://verdaccio.tld', + bugs: { + url: 'https://verdaccio.tld/bugs', + }, + dist: { + tarball: 'https://verdaccio.tld/download', + }, + }, +})); + +jest.mock('../../pages/Version', () => ({ + DetailContextConsumer: component => { + return component.children({ packageMeta: mockPackageMeta() }); + }, +})); describe('extends Component
{ public state = { tabPosition: 0, @@ -37,10 +42,10 @@ class DetailContainer
extends Component
{
private renderListTabs(tabPosition: number): React.ReactElement To publish your first package just: 1. Login 2. Publish 3. Refresh this page. To publish your first package just: 1. Login 2. Publish 3. Refresh this page. ${readmeText}
-
- );
- };
+ return (
+
+
+ );
+};
- private renderCopyCLI = () => {
- return
+ contributors
+
+
+ maintainers
+
+ {'Latest Distribution'}}>
-
{'Latest Distribution'}}>
+
);
};
diff --git a/src/components/Dist/__snapshots__/Dist.test.tsx.snap b/src/components/Dist/__snapshots__/Dist.test.tsx.snap
index 15ebd6c..8aa3173 100644
--- a/src/components/Dist/__snapshots__/Dist.test.tsx.snap
+++ b/src/components/Dist/__snapshots__/Dist.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
"`;
+exports[`Latest Distribution
"`;
-exports[`Latest Distribution
"`;
+exports[`Latest Distribution
"`;
-exports[`Latest Distribution
"`;
+exports[`Latest Distribution
"`;
diff --git a/src/components/Engines/Engines.test.tsx b/src/components/Engines/Engines.test.tsx
index 3339b2e..4756588 100644
--- a/src/components/Engines/Engines.test.tsx
+++ b/src/components/Engines/Engines.test.tsx
@@ -1,12 +1,31 @@
import React from 'react';
-import { shallow } from 'enzyme';
+import { mount } from 'enzyme';
+import Engine from './Engines';
jest.mock('./img/node.png', () => '');
jest.mock('../Install/img/npm.svg', () => '');
+const mockPackageMeta = jest.fn(() => ({
+ latest: {
+ homepage: 'https://verdaccio.tld',
+ bugs: {
+ url: 'https://verdaccio.tld/bugs',
+ },
+ dist: {
+ tarball: 'https://verdaccio.tld/download',
+ },
+ },
+}));
+
+jest.mock('../../pages/Version', () => ({
+ DetailContextConsumer: component => {
+ return component.children({ packageMeta: mockPackageMeta() });
+ },
+}));
+
describe('Latest Distribution
{text.split('-').join(' ')}}>
-
{text.split('-').join(' ')}}>
+
node JS
NPM version
node JS
NPM version
No Package Published Yet.
No Package Published Yet.
{'Installation'}}>{this.renderListItems(packageName)}
+ {'Installation'}}>{this.renderListItems(packageName)}
>
);
};
@@ -35,17 +34,17 @@ class Install extends Component {
public renderListItems = (packageName: string) => {
return (
<>
- test
"`;
+exports[`test
"`;
-exports[`This is a test string
"`;
+exports[`This is a test string
"`;
diff --git a/src/components/NotFound/NotFound.tsx b/src/components/NotFound/NotFound.tsx
index b5fdd07..7bb923f 100644
--- a/src/components/NotFound/NotFound.tsx
+++ b/src/components/NotFound/NotFound.tsx
@@ -1,46 +1,43 @@
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
import withWidth, { isWidthUp } from '@material-ui/core/withWidth';
-import React from 'react';
+import React, { useCallback } from 'react';
import { RouteComponentProps, withRouter } from 'react-router-dom';
import PackageImg from './img/package.svg';
import { Card, EmptyPackage, Heading, Inner, List, Wrapper } from './styles';
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
-export const NOT_FOUND_TEXT = "Sorry, we couldn't find it...";
+export const NOT_FOUND_TEXT = `Sorry, we couldn't find it...`;
+export const LABEL_NOT_FOUND = `The page you're looking for doesn't exist.`;
+export const LABEL_FOOTER_NOT_FOUND = 'Perhaps these links will help find what you are looking for:';
export type NotFoundProps = RouteComponentProps & { width: Breakpoint; history };
-const NotFound: React.FC
-
);
- const renderSubTitle = (): JSX.Element => (
- This is a test string
{'Repository'}
{'Repository'}}>
+
diff --git a/src/components/Repository/__snapshots__/Repository.test.tsx.snap b/src/components/Repository/__snapshots__/Repository.test.tsx.snap
index 193dd0b..0d451da 100644
--- a/src/components/Repository/__snapshots__/Repository.test.tsx.snap
+++ b/src/components/Repository/__snapshots__/Repository.test.tsx.snap
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
"`;
+exports[`Repository
"`;
diff --git a/src/components/Repository/styles.ts b/src/components/Repository/styles.ts
index 4a55ccb..b753aa9 100644
--- a/src/components/Repository/styles.ts
+++ b/src/components/Repository/styles.ts
@@ -6,6 +6,7 @@ import Typography from '@material-ui/core/Typography';
import Github from '../../icons/GitHub';
import colors from '../../utils/styles/colors';
import { fontWeight } from '../../utils/styles/sizes';
+import ListItemText from '@material-ui/core/ListItemText';
export const Heading = styled(Typography)({
'&&': {
@@ -36,7 +37,16 @@ export const GithubLogo = styled(Github)({
export const RepositoryListItem = styled(ListItem)({
'&&': {
- paddingLeft: 0,
- paddingRight: 0,
+ padding: 0,
+ },
+ '&&:hover': {
+ backgroundColor: 'transparent',
+ },
+});
+
+export const RepositoryListItemText = styled(ListItemText)({
+ '&&': {
+ padding: '0 10px',
+ margin: 0,
},
});
diff --git a/src/components/Search/Search.test.tsx b/src/components/Search/Search.test.tsx
index 795d106..93e9443 100644
--- a/src/components/Search/Search.test.tsx
+++ b/src/components/Search/Search.test.tsx
@@ -5,7 +5,7 @@ import { BrowserRouter } from 'react-router-dom';
import Search from './Search';
const SEARCH_FILE_PATH = './Search';
-const API_FILE_PATH = '../../utils/api';
+const API_FILE_PATH = '../../utils/calls';
const URL_FILE_PATH = '../../utils/url';
// Global mocks
@@ -165,8 +165,7 @@ describe('Repository
+
{Object.keys(packages)
.reverse()
.map(version => (
);
};
- public renderContent(packageMeta): ReactElement
+ {Object.keys(packages)
+ .reverse()
+ .map(tag => (
+
+ );
+ };
+
+ public renderContent(packageMeta, packageName): ReactElementCurrent Tags
Version History
"`;
diff --git a/src/pages/Version/Layout.tsx b/src/pages/Version/Layout.tsx
new file mode 100644
index 0000000..66292bb
--- /dev/null
+++ b/src/pages/Version/Layout.tsx
@@ -0,0 +1,27 @@
+import React, { FC, ReactElement } from 'react';
+import Grid from '@material-ui/core/Grid';
+import DetailContainer from '../../components/DetailContainer';
+import DetailSidebar from '../../components/DetailSidebar';
+
+function renderDetail(): ReactElement