Skip to content

Commit

Permalink
chore: add stream search cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Aug 18, 2022
1 parent 7941069 commit c5e2e58
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _src/react-app/components/location/StreamSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ export default function StreamSearch({ map, streamsFeatureService, lakesFeatureS
<div className="magic-zoom">
<div className="row">
<div className="input-group" {...getComboboxProps()}>
<input className="form-control" placeholder="stream/lake name" type="text" {...getInputProps()} />
<input
className="form-control"
placeholder="stream/lake name"
type="text"
name="stream search"
{...getInputProps()}
/>
<span className="input-group-addon">
<span className="glyphicon glyphicon-search"></span>
</span>
Expand Down
16 changes: 16 additions & 0 deletions cypress/e2e/stream_search.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import commonIntercepts from './common_intercepts';
import { loadAndSignIn } from './utils';

describe('StreamSearch', () => {
it('successfully zooms to a stream', () => {
commonIntercepts();
loadAndSignIn();

cy.get('#downshift-0-input').type('stream');
cy.get('#downshift-0-item-0').click();

cy.get(
'[d="M570 287L631 280L658 264L676 237L668 217L628 176L622 144L614 121L598 121L570 108L547 107L524 114L509 122L497 137L473 157L464 215L462 260L464 284L491 290z"]'
).should('be.visible');
});
});

0 comments on commit c5e2e58

Please sign in to comment.