diff --git a/spec/javascripts/modules/add-permissions-with-autocomplete-spec.js b/spec/javascripts/modules/add-permissions-with-autocomplete-spec.js new file mode 100644 index 0000000000..06a3fdd408 --- /dev/null +++ b/spec/javascripts/modules/add-permissions-with-autocomplete-spec.js @@ -0,0 +1,50 @@ +// describe('GOVUK.Modules.AccessibleAutocomplete', function () { +// let component, module + +// beforeEach(function () { +// component = document.createElement('div') +// component.setAttribute('data-module', 'accessible-autocomplete') +// component.innerHTML = ` +// + +//
+// Search for the permission you want to add. + +// +//
+// ` +// module = new GOVUK.Modules.AccessibleAutocomplete(component) +// module.init() +// }) + +// it('updates the value of the select element when selected via the autocomplete element', function () { +// const autocompleteInput = component.querySelector('.autocomplete__input') +// autocompleteInput.value = 'per' + +// // not found +// const firstAutocompleteListItem = component.querySelector('#new_permission_id__option--0') +// firstAutocompleteListItem.click() + +// const selectInput = component.querySelector('select') +// expect(selectInput.value).toBe(1) +// }) + +// // it('resets the value of the select element when the value of the autocomplete element no longer matches', function () { + +// // }) + +// // it('clears the value of the select and autocomplete elements when clicking the clear button', function () { + +// // }) +// })