Skip to content

Commit

Permalink
test: removing unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Apr 1, 2024
1 parent 7586280 commit 0d58997
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions src/studio-home/StudioHome.test.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { getConfig, initializeMockApp, setConfig } from '@edx/frontend-platform';
import { initializeMockApp } from '@edx/frontend-platform';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { IntlProvider, injectIntl } from '@edx/frontend-platform/i18n';
import { AppProvider } from '@edx/frontend-platform/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {
act, fireEvent, render, waitFor, screen,
act, fireEvent, render, waitFor,
} from '@testing-library/react';
import MockAdapter from 'axios-mock-adapter';

Expand Down Expand Up @@ -42,15 +41,11 @@ jest.mock('react-router-dom', () => ({
}),
}));

const queryClient = new QueryClient();

const RootWrapper = () => (
<AppProvider store={store}>
<QueryClientProvider client={queryClient}>
<IntlProvider locale="en" messages={{}}>
<StudioHome intl={injectIntl} />
</IntlProvider>
</QueryClientProvider>
<IntlProvider locale="en" messages={{}}>
<StudioHome intl={injectIntl} />
</IntlProvider>
</AppProvider>
);

Expand Down Expand Up @@ -81,11 +76,6 @@ describe('<StudioHome />', async () => {
const { getByText } = render(<RootWrapper />);
expect(getByText('Studio home')).toBeInTheDocument();
});

it('should render Studio home title', () => {
render(<RootWrapper />);
screen.logTestingPlaygroundURL();
});
});

describe('api fetch succeeds', () => {
Expand Down Expand Up @@ -259,23 +249,5 @@ describe('<StudioHome />', async () => {
expect(getByText('Looking for help with Studio?')).toBeInTheDocument();
expect(getByText('LMS')).toHaveAttribute('href', process.env.LMS_BASE_URL);
});

it('should show search button and open search modal when button clicked, if search flag enabled', async () => {
setConfig({
...getConfig(),
MEILISEARCH_ENABLED: 'false',
});
const { queryByRole } = render(<RootWrapper />);
expect(queryByRole('button', { name: 'Search content' })).not.toBeInTheDocument();
});

it('should show search button if meilisearch flag disabled', async () => {
setConfig({
...getConfig(),
MEILISEARCH_ENABLED: 'false',
});
const { queryByRole } = render(<RootWrapper />);
expect(queryByRole('button', { name: 'Search content' })).not.toBeInTheDocument();
});
});
});
Empty file added webpack.dev-tutor.config.js
Empty file.

0 comments on commit 0d58997

Please sign in to comment.