Skip to content

Commit

Permalink
Update Plugins page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-vl committed Jan 31, 2024
1 parent ab3e2bc commit ed020d9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/components/App/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ describe('App', () => {
* Rendering
*/
describe('rendering', () => {
it('Should render community page', async () => {
it('Should render plugins page', async () => {
render(
<BrowserRouter>
<App basename={APP_INFO.root} meta={meta} path={null as any} query={null as any} onNavChanged={jest.fn()} />
</BrowserRouter>
);

expect(screen.queryByTestId(TEST_IDS.development.root)).not.toBeInTheDocument();
expect(screen.getByTestId(TEST_IDS.community.root)).toBeInTheDocument();
expect(screen.getByTestId(TEST_IDS.plugins.root)).toBeInTheDocument();
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { Route, Switch } from 'react-router-dom';

import { AppSettings } from '../../types';
import { Community } from '../Community';
import { PluginsPage } from './Plugins.page';

/**
* Properties
Expand All @@ -16,7 +16,7 @@ interface Props extends AppRootProps<AppSettings> {}
export const App: React.FC<Props> = () => {
return (
<Switch>
<Route component={Community} />
<Route component={PluginsPage} />
</Switch>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import {
interface Props extends PluginPageProps {}

/**
* Community
* Plugins
*/
export const Community: React.FC<Props> = () => {
export const PluginsPage: React.FC<Props> = () => {
return (
<PluginPage>
<div data-testid={TEST_IDS.community.root}>
<div data-testid={TEST_IDS.plugins.root}>
<ApacheEcharts />
<Base64Image />
<Calendar />
Expand Down
1 change: 0 additions & 1 deletion src/components/Community/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './App';
export * from './Community';
export * from './Config';
3 changes: 1 addition & 2 deletions src/constants/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ export const APP_INFO = {
* Routes
*/
export const APP_ROUTES = {
community: `${APP_INFO.root}`,
development: `${APP_INFO.root}/development`,
plugins: `${APP_INFO.root}`,
};
7 changes: 2 additions & 5 deletions src/constants/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ export const TEST_IDS = {
config: {
root: 'data-testid config',
},
community: {
root: 'data-testid root-page community',
},
development: {
root: 'data-testid root-page development',
plugins: {
root: 'data-testid root-page plugins',
},
};

0 comments on commit ed020d9

Please sign in to comment.