visual updates to optional fields in manual bib entry (#33102)

* visual updates to optional fields in manual bib entry

* omitting onClose from button auto complete props

GitOrigin-RevId: 922695e8eaec83702b482123dc4b4483fe957b78
This commit is contained in:
l-obrien-overleaf
2026-04-28 08:07:21 +00:00
committed by Copybot
parent 7eee5809bb
commit 6b78b42469
2 changed files with 28 additions and 0 deletions
@@ -59,6 +59,7 @@ function render(props: RenderProps) {
createOptionPrefix={props.createOptionPrefix}
useFuzzySearch={props.useFuzzySearch}
expandUp={props.expandUp}
onClose={props.onClose}
/>
<button type="submit">submit</button>
</form>
@@ -255,6 +256,26 @@ describe('<OLAutocomplete />', function () {
cy.findByLabelText('Delete').should('not.exist')
})
it('calls onClose when an item is selected', function () {
const closeHandler = cy.stub().as('closeHandler')
render({ items: testItems, onClose: closeHandler })
cy.findByRole('combobox').click()
cy.findByText('Banana').click()
cy.get('@closeHandler').should('have.been.calledOnce')
})
it('calls onClose when Escape is pressed', function () {
const closeHandler = cy.stub().as('closeHandler')
render({ items: testItems, onClose: closeHandler })
cy.findByRole('combobox').click()
cy.findByRole('combobox').type('{esc}')
cy.get('@closeHandler').should('have.been.calledOnce')
})
})
describe('clear button', function () {