diff --git a/app/assets/javascripts/components/search/Search.jsx b/app/assets/javascripts/components/search/Search.jsx index e6003a311..267cf707e 100644 --- a/app/assets/javascripts/components/search/Search.jsx +++ b/app/assets/javascripts/components/search/Search.jsx @@ -4,11 +4,7 @@ import Stories from '../stories/Stories'; import * as Story from '../../models/beta/story'; export const SearchHeader = ({ stories }) => ( -
+
{I18n.t('stories_found')}: {stories.length}
@@ -19,13 +15,9 @@ export const SearchHeader = ({ stories }) => ( ); const Search = ({ stories }) => ( -
+
-
+
', () => { describe('when isEnabled is false', () => { it('does not render the component', () => { - const { queryByTestId } = renderComponent(); + const { container } = renderComponent(); - expect(queryByTestId('sprint-container')).not.toBeInTheDocument(); + expect(container.querySelector('.Sprint')).not.toBeInTheDocument(); }); }); describe('when isEnabled is true', () => { it('renders the component', () => { - const { getByTestId } = renderComponent({ isEnabled: true }); + const { container } = renderComponent({ isEnabled: true }); - expect(getByTestId('sprint-container')).toBeInTheDocument(); + expect(container.querySelector('.Sprint')).toBeInTheDocument(); }); }); }); diff --git a/spec/javascripts/components/search/search_spec.js b/spec/javascripts/components/search/search_spec.js index 2fd7983a6..132b35478 100644 --- a/spec/javascripts/components/search/search_spec.js +++ b/spec/javascripts/components/search/search_spec.js @@ -32,16 +32,16 @@ describe('', () => { }); it('renders header', () => { - const { getByTestId } = renderComponent(); + const { container } = renderComponent(); - expect(getByTestId('search-header-container')).toBeInTheDocument(); + expect(container.querySelector('.Sprint__header')).toBeInTheDocument(); }); it('renders stories', () => { - const { getByTestId } = renderComponent(); + const { container } = renderComponent(); - expect(getByTestId('search-header-container')).toBeInTheDocument(); - expect(getByTestId('stories-search-container')).toBeInTheDocument(); + expect(container.querySelector('.Sprint__header')).toBeInTheDocument(); + expect(container.querySelector('.Sprint__body')).toBeInTheDocument(); }); }); @@ -65,15 +65,15 @@ describe('', () => { }); it('renders header', () => { - const { getByTestId } = renderComponent(); + const { container } = renderComponent(); - expect(getByTestId('search-header-container')).toBeInTheDocument(); + expect(container.querySelector('.Sprint__header')).toBeInTheDocument(); }); it('renders stories', () => { - const { getByTestId } = renderComponent(); + const { container } = renderComponent(); - expect(getByTestId('stories-search-container')).toBeInTheDocument(); + expect(container.querySelector('.Sprint__body')).toBeInTheDocument(); }); }); });