Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #316 from uktrade/feature/match-company-content-ch…
Browse files Browse the repository at this point in the history
…anges

Update content around DNB company search when no matches are found
  • Loading branch information
ian-leggett authored Jul 9, 2020
2 parents 1d7337f + 9eccdca commit 3e476ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 7 additions & 5 deletions src/forms/elements/FieldDnbCompany.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ const FieldDnbCompany = ({
)}

{!error && entities.length === 0 && (
<StatusMessage>There are no companies to show.</StatusMessage>
<StatusMessage>
No match found. Try one of the options below.
</StatusMessage>
)}

{error && (
Expand All @@ -145,17 +147,17 @@ const FieldDnbCompany = ({
<Paragraph>Try:</Paragraph>

<StyledUnorderedList>
<ListItem>checking or removing the postcode</ListItem>
<ListItem>
removing &quot;limited&quot; or &quot;ltd&quot;
</ListItem>
<ListItem>checking for spelling errors</ListItem>
{country && (
<ListItem>checking if the right country was selected</ListItem>
)}
<ListItem>
check you&apos;re using the company&apos;s registered name
</ListItem>
<ListItem>checking or removing the postcode</ListItem>
<ListItem>
removing &quot;limited&quot; or &quot;ltd&quot;
</ListItem>
</StyledUnorderedList>

{onCannotFind && (
Expand Down
18 changes: 9 additions & 9 deletions src/forms/elements/__tests__/FieldDnbCompany.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ describe('FieldDnbCompany', () => {

test('should show a warning', () => {
expect(wrapper.find(StatusMessage).text()).toEqual(
'There are no companies to show.'
'No match found. Try one of the options below.'
)
})

Expand Down Expand Up @@ -341,10 +341,10 @@ describe('FieldDnbCompany', () => {
await performSearch(fieldWrapper)

expect(fieldWrapper.find('ul').text()).toEqual(
'checking for spelling errors' +
"check you're using the company's registered name" +
'checking or removing the postcode' +
'removing "limited" or "ltd"'
'checking or removing the postcode' +
'removing "limited" or "ltd"' +
'checking for spelling errors' +
"check you're using the company's registered name"
)
})
})
Expand All @@ -361,11 +361,11 @@ describe('FieldDnbCompany', () => {
await performSearch(fieldWrapper)

expect(fieldWrapper.find('ul').text()).toEqual(
'checking for spelling errors' +
'checking or removing the postcode' +
'removing "limited" or "ltd"' +
'checking for spelling errors' +
'checking if the right country was selected' +
"check you're using the company's registered name" +
'checking or removing the postcode' +
'removing "limited" or "ltd"'
"check you're using the company's registered name"
)
})
})
Expand Down

0 comments on commit 3e476ac

Please sign in to comment.