Skip to content

Commit

Permalink
test(navbar.tsx): remove the search bar and button from the navbar
Browse files Browse the repository at this point in the history
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 HospitalRun#2230
  • Loading branch information
kilcorse-michael committed Jul 16, 2020
1 parent 8324e2b commit afe4497
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
20 changes: 0 additions & 20 deletions src/__tests__/shared/components/navbar/Navbar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 1 addition & 10 deletions src/shared/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit afe4497

Please # to comment.