Skip to content

Commit

Permalink
update snapshots and props
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-odonovan committed Oct 4, 2023
1 parent 476f482 commit 72b8fb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
21 changes: 12 additions & 9 deletions src/components/Molecules/PostcodeLookup/PostcodeLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ const addressFetcher = async postcode => {
* @constructor
*/
const PostcodeLookup = ({
onSelect, name, label, ...rest
onSelect, label, placeholder, buttonText, noResultsMessage, ...rest
}) => (
<StyledWrapper>
<Lookup
name={name}
label={label}
placeholder="Enter postcode..."
buttonText="Find address"
noResultsMessage="Sorry, could not find any addresses for that postcode"
placeholder={placeholder}
buttonText={buttonText}
noResultsMessage={noResultsMessage}
mapOptionToString={addressToString}
lookupHandler={addressFetcher}
onSelect={onSelect}
Expand All @@ -67,13 +66,17 @@ const PostcodeLookup = ({

PostcodeLookup.propTypes = {
onSelect: PropTypes.func.isRequired,
name: PropTypes.string,
label: PropTypes.string
label: PropTypes.string,
placeholder: PropTypes.string,
buttonText: PropTypes.string,
noResultsMessage: PropTypes.string
};

PostcodeLookup.defaultProps = {
name: 'postcode_lookup',
label: 'Find address by postcode'
label: 'Find address by postcode',
placeholder: 'Enter postcode...',
buttonText: 'Find address',
noResultsMessage: 'Sorry, could not find any addresses for that postcode'
};

export default PostcodeLookup;
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ exports[`renders correctly 1`] = `
>
<label
className="c3 TextInputWithDropdown__input"
htmlFor="postcode_lookup"
>
<span
className="c4 c5"
Expand All @@ -178,11 +177,8 @@ exports[`renders correctly 1`] = `
>
<input
aria-describedby="postcode_lookup"
autoComplete="off"
className="c7"
id="postcode_lookup"
name="postcode_lookup"
onChange={[Function]}
onKeyPress={[Function]}
placeholder="Enter postcode..."
Expand Down

0 comments on commit 72b8fb6

Please sign in to comment.