generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from eea/develop
Fix crash in dataset view
- Loading branch information
Showing
7 changed files
with
152 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import DatasetUrls from './DatasetUrls'; | ||
|
||
jest.mock('@eeacms/search', () => ({ | ||
runRequest: jest.fn(), | ||
})); | ||
|
||
const dataset = { | ||
'WWW:URL': [ | ||
{ | ||
url: 'https://example.org/1', | ||
name: 'Direct download', | ||
description: 'Download link description', | ||
}, | ||
], | ||
}; | ||
|
||
describe('DatasetUrl', () => { | ||
it('renders correctly', () => { | ||
const tree = renderer.create(<DatasetUrls dataset={dataset} />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
39 changes: 39 additions & 0 deletions
39
src/components/ItemView/Datasets/__snapshots__/DatasetUrls.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DatasetUrl renders correctly 1`] = ` | ||
<div | ||
className="item" | ||
onClick={[Function]} | ||
role="listitem" | ||
> | ||
<div | ||
className="content" | ||
> | ||
<div | ||
className="dataset-item" | ||
> | ||
<i | ||
aria-hidden="true" | ||
className="icon download" | ||
onClick={[Function]} | ||
/> | ||
<a | ||
className="item-link" | ||
href="https://example.org/1" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<span> | ||
Direct download | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
<span | ||
className="item-description" | ||
title="Download link description" | ||
> | ||
Download link description | ||
</span> | ||
</div> | ||
`; |