Skip to content

Commit

Permalink
add tests for plugins tab
Browse files Browse the repository at this point in the history
  • Loading branch information
markkaylor committed Jun 7, 2022
1 parent e9288e2 commit 00f5dd3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/core/admin/admin/src/pages/MarketplacePage/index.js
Expand Up @@ -232,7 +232,10 @@ const MarketPlacePage = () => {
/>
) : (
<TabGroup
label={formatMessage({ id: 'admin.pages.MarketPlacePage.tab-group.label' })}
label={formatMessage({
id: 'admin.pages.MarketPlacePage.tab-group.label',
defaultMessage: 'Plugins and Providers for Strapi',
})}
id="tabs"
variant="simple"
>
Expand Down
Expand Up @@ -6,6 +6,7 @@ import {
getByPlaceholderText,
fireEvent,
screen,
getByText,
} from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from 'react-query';
Expand Down Expand Up @@ -1000,7 +1001,7 @@ describe('Marketplace page', () => {
class="c29"
>
<div
aria-label="admin.pages.MarketPlacePage.tab-group.label"
aria-label="Plugins and Providers for Strapi"
role="tablist"
>
<button
Expand Down Expand Up @@ -1814,4 +1815,16 @@ describe('Marketplace page', () => {

expect(offlineText).toBeVisible();
});

it('defaults to plugins tabs', async () => {
render(App);
const button = screen.getByRole('tab', { selected: true });
const pluginsTab = await getByText(button, /Plugins/i);

const tabPanel = screen.getByRole('tabpanel');
const pluginCardText = await getByText(tabPanel, 'Comments');

expect(pluginsTab).not.toBe(null);
expect(pluginCardText).toBeVisible();
});
});

0 comments on commit 00f5dd3

Please sign in to comment.