diff --git a/tests/javascripts/liveSearch.test.js b/tests/javascripts/liveSearch.test.js index ba7422b92..59ff768bd 100644 --- a/tests/javascripts/liveSearch.test.js +++ b/tests/javascripts/liveSearch.test.js @@ -29,51 +29,42 @@ describe('Live search', () => { searchLabelText = "Search branding styles by name"; - function getRadiosHTML (departments) { - - let result = ''; - - departments.forEach((department, idx) => result += ` -
- - -
- `); - - return result; - - }; - beforeEach(() => { - const departments = [ - { - 'label': 'NHS', - 'id': 'nhs', - 'name': 'branding' - }, - { - 'label': 'Department for Work and Pensions', - 'id': 'dwp', - 'name': 'branding' - }, - { - 'label': 'Department for Education', - 'id': 'dfe', - 'name': 'branding' - }, - { - 'label': 'Home Office', - 'id': 'home-office', - 'name': 'branding' - } - ]; + const departmentData = { + name: 'departments', + hideLegend: true, + fields: [ + { + 'label': 'NHS', + 'id': 'nhs', + 'name': 'branding', + 'value': 'nhs' + }, + { + 'label': 'Department for Work and Pensions', + 'id': 'dwp', + 'name': 'branding', + 'value': 'dwp' + }, + { + 'label': 'Department for Education', + 'id': 'dfe', + 'name': 'branding', + 'value': 'dfe' + }, + { + 'label': 'Home Office', + 'id': 'home-office', + 'name': 'branding', + 'value': 'home-office' + } + ] + }; // set up DOM document.body.innerHTML = ` -