diff --git a/app/views/cdo/search/basic.njk b/app/views/cdo/search/basic.njk index b5c12062..21fe7229 100644 --- a/app/views/cdo/search/basic.njk +++ b/app/views/cdo/search/basic.njk @@ -27,13 +27,13 @@ Dog records - Search {{ govukInput(model.searchTerms) }} - {{ govukRadios(model.searchType) }} - {% if model.searchTerms.value %} {{ govukCheckboxes(model.fuzzy) }} {% endif %} + + {{ govukButton({ text: "Search", value: "primary" diff --git a/app/views/cdo/search/dog-results.njk b/app/views/cdo/search/dog-results.njk index 4973da81..171d18c6 100644 --- a/app/views/cdo/search/dog-results.njk +++ b/app/views/cdo/search/dog-results.njk @@ -1,59 +1,64 @@ {% from "components/statusTag/macro.njk" import statusTag %}
-
-

+
+

{{ result.dogIndex }}

-
    -
  • - {{ statusTag(result.dogStatus, result.dogSubStatus, 'govuk-!-font-size-16') }} -
  • -
-
- - - - - - - - - - - - - - - - - -
-
- Dog name - - Owner name - - Microchip number -
- {{ result.dogName }} - {% if result.dogNameNotEntered %} - Not entered - {% endif %} - - - {{ result.firstName }} {{ result.lastName }} - - - {{ result.microchipNumber }} - {% if result.microchipNumberNotEntered %} - Not entered - {% endif %} -
- {{ result.microchipNumber2 }} -
+ +
+
+
+
+ Status +
+
+ {{ statusTag(result.dogStatus, result.dogSubStatus, 'govuk-!-font-size-16') }} +
+
+
+
Dog
+ {% if result.dogNameNotEntered %} +
Not entered
+ {% else %} +
{{ result.dogName }}
+ {% endif %} +
+ +
+
+ Address +
+
+ {% if result.address %} {{ result.address }} {% endif %} +
+
+
+
+ Microchip number +
+ {% if result.microchipNumberNotEntered %} +
Not entered
+ {% else %} +
+ {{ result.microchipNumber }} + {% if result.microchipNumber2 %} +
+ {{ result.microchipNumber2 }} + {% endif %} + {% endif %} +
+
+
diff --git a/package.json b/package.json index 7823934c..d55f897e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aphw-ddi-portal", - "version": "0.96.52", + "version": "0.97.1", "description": "Web frontend for managing the dogs index", "homepage": "https://github.com/DEFRA/aphw-ddi-portal", "main": "app/index.js", diff --git a/test/integration/narrow/routes/cdo/search-basic.test.js b/test/integration/narrow/routes/cdo/search-basic.test.js index 8b19eb0f..8ada3275 100644 --- a/test/integration/narrow/routes/cdo/search-basic.test.js +++ b/test/integration/narrow/routes/cdo/search-basic.test.js @@ -64,12 +64,7 @@ describe('SearchBasic test', () => { { results: [ { - address: { - town: 'LONDON', - postcode: 'W1K 7EB', - address_line_1: '47 PARK STREET', - address_line_2: null - }, + address: '47 PARK STREET, LONDON, W1K 7EB', dogName: '', dogIndex: 'ED300242', lastName: 'Ralph', @@ -95,9 +90,11 @@ describe('SearchBasic test', () => { const { document } = new JSDOM(response.payload).window expect(response.statusCode).toBe(200) - const [dogNameResult, ownerNameResult, microchipNumberResult] = document.querySelectorAll('.defra-results') + const [statusResult, dogNameResult, ownerNameResult, ownerAddressResult, microchipNumberResult] = document.querySelectorAll('.govuk-summary-list__value') + expect(statusResult.textContent.trim()).toBe('Applying for exemption') expect(dogNameResult.textContent.trim()).toBe('Not entered') expect(ownerNameResult.textContent.trim()).toBe('Wreck it Ralph') + expect(ownerAddressResult.textContent.trim()).toBe('47 PARK STREET, LONDON, W1K 7EB') expect(microchipNumberResult.textContent.trim()).toBe('Not entered') expect(document.querySelector('.govuk-tag').textContent.trim()).toBe('Applying for exemption') })