Skip to content

Commit

Permalink
Updates based on PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
jermnelson committed Oct 24, 2019
1 parent 7f5ee01 commit a4d9c2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions __tests__/components/search/Search.test.js
Expand Up @@ -140,9 +140,8 @@ describe('<Search />', () => {
expect(mockGetSearchResults).toBeCalledWith('foo', 0, 10, undefined, undefined)

// Result
expect(await findByText('Your List of Bibliographic Metadata Stored in Sinopia')).toBeInTheDocument()
expect(await findByText('foo')).toBeInTheDocument()

expect(getByText('foo', { selector: 'td' })).toBeInTheDocument()
expect(getByText('http://id.loc.gov/ontologies/bibframe/Title', { selector: 'li' }))
.toBeInTheDocument()
})
Expand Down
1 change: 0 additions & 1 deletion cypress/integration/end2end.spec.js
Expand Up @@ -88,7 +88,6 @@ describe('End-to-end test', () => {
cy.get('input#searchInput')
.type(`${title}{enter}`, { force: true })

cy.contains('Your List of Bibliographic Metadata Stored in Sinopia')
cy.contains(title)
})

Expand Down
7 changes: 3 additions & 4 deletions src/components/search/SinopiaSearchResults.jsx
Expand Up @@ -6,6 +6,7 @@ import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import PropTypes from 'prop-types'
import Config from 'Config'
import shortid from 'shortid'
import { getCurrentUser } from 'authSelectors'
import { copyNewResource } from 'actions/index'
import { retrieveResource } from 'actionCreators/resources'
Expand Down Expand Up @@ -48,9 +49,9 @@ const SinopiaSearchResults = (props) => {
// TODO: Turn this function into a functional component
const generateRows = () => {
const rows = []
props.searchResults.forEach((row, _index) => {
props.searchResults.forEach((row) => {
const link = `${Config.sinopiaServerBase}/${row.uri}`
rows.push(<tr key={_index}>
rows.push(<tr key={shortid.generate()}>
<td>{ row.label }</td>
<td>
<ul className="list-unstyled">
Expand Down Expand Up @@ -90,8 +91,6 @@ const SinopiaSearchResults = (props) => {
<div id="search-results" className="row">
<div className="col-sm-2"></div>
<div className="col-sm-8">
<h3>Your List of Bibliographic Metadata Stored in Sinopia</h3>

<table className="table table-bordered" id="search-results-list">
<thead>
<tr>
Expand Down

0 comments on commit a4d9c2e

Please sign in to comment.