From afe4497cdc619e33bde79b35968671c54357bd65 Mon Sep 17 00:00:00 2001 From: Michael A Kilcorse <47223858+kilcorse-michael@users.noreply.github.com> Date: Thu, 16 Jul 2020 10:43:15 -0400 Subject: [PATCH] test(navbar.tsx): remove the search bar and button from the navbar Remove the search bar and button from the bar and adjust the page list and settings icons so that they continue to hug the right side of the screen and updated the tests to remove the search component so it does not flag when testing. navbar and feat #2230 --- .../shared/components/navbar/Navbar.test.tsx | 20 ------------------- src/shared/components/navbar/Navbar.tsx | 11 +--------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/__tests__/shared/components/navbar/Navbar.test.tsx b/src/__tests__/shared/components/navbar/Navbar.test.tsx index d3c7b78d5d..519dbc32f4 100644 --- a/src/__tests__/shared/components/navbar/Navbar.test.tsx +++ b/src/__tests__/shared/components/navbar/Navbar.test.tsx @@ -122,26 +122,6 @@ describe('Navbar', () => { }) }) - describe('search', () => { - it('should render Search as the search box placeholder', () => { - const wrapper = setup(allPermissions) - const hospitalRunNavbar = wrapper.find(HospitalRunNavbar) - const navSearch = hospitalRunNavbar.find('.nav-search') - const { children } = navSearch.first().props() as any - - expect(children.props.children[0].props.placeholder).toEqual('actions.search') - }) - - it('should render Search as the search button label', () => { - const wrapper = setup(allPermissions) - const hospitalRunNavbar = wrapper.find(HospitalRunNavbar) - const navSearch = hospitalRunNavbar.find('.nav-search') - const { children } = navSearch.first().props() as any - - expect(children.props.children[1].props.children).toEqual('actions.search') - }) - }) - describe('add new', () => { it('should show a shortcut if user has a permission', () => { const wrapper = setup(allPermissions) diff --git a/src/shared/components/navbar/Navbar.tsx b/src/shared/components/navbar/Navbar.tsx index e77262ce25..9753990736 100644 --- a/src/shared/components/navbar/Navbar.tsx +++ b/src/shared/components/navbar/Navbar.tsx @@ -75,20 +75,11 @@ const Navbar = () => { }, className: 'nav-header', }, - { - type: 'search', - placeholderText: t('actions.search'), - className: 'ml-auto d-none d-md-block nav-search', - buttonText: t('actions.search'), - buttonColor: 'secondary', - onClickButton: () => undefined, - onChangeInput: () => undefined, - }, { type: 'link-list-icon', alignRight: true, children: getDropdownListOfPages(addPages), - className: 'pl-4 nav-add-new d-none d-md-block', + className: 'ml-auto nav-add-new d-none d-md-block', iconClassName: 'align-bottom', label: 'Add', name: 'add',