From 1fbcd7e4346bd82fcb7034fdc7374c9059882330 Mon Sep 17 00:00:00 2001 From: nixocio Date: Thu, 8 Oct 2020 09:06:50 -0400 Subject: [PATCH] Update AddDropDownButton to show down caret Update AddDropDownButton to show down caret See: https://github.com/ansible/awx/issues/7721 --- .../components/AddDropDownButton/AddDropDownButton.jsx | 7 ++++++- .../components/PaginatedDataList/ToolbarAddButton.jsx | 10 +++++++++- .../PaginatedDataList/ToolbarAddButton.test.jsx | 9 +++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx index ca4c4a40b6..f48e554317 100644 --- a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx +++ b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx @@ -48,7 +48,12 @@ function AddDropDownButton({ dropdownItems, i18n }) { isPlain isOpen={isOpen} position={DropdownPosition.right} - toggle={ setIsOpen(!isOpen)} />} + toggle={ + setIsOpen(!isOpen)} + /> + } dropdownItems={dropdownItems.map(item => ( + ); diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx index ad5bde5bd4..682ce46177 100644 --- a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx +++ b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx @@ -18,4 +18,13 @@ describe('', () => { expect(link).toHaveLength(1); expect(link.prop('to')).toBe('/foo'); }); + + test('should render link with toggle icon', () => { + const wrapper = mountWithContexts( + + ); + const link = wrapper.find('Link'); + expect(link).toHaveLength(1); + expect(link.prop('to')).toBe('/foo'); + }); });