+
', () => {
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();
});
});
});