Skip to content

Commit

Permalink
WIP branch for HMS-1623 detail page view
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Nov 7, 2023
1 parent 732dfa2 commit 88c8f92
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
preset: 'ts-jest',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.js', '!src/**/stories/*'],
coverageDirectory: './coverage/',
Expand Down
8 changes: 2 additions & 6 deletions src/Routes/DefaultPage/DefaultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ const Header = () => {
);
};

interface EmptyContentProps {
isLoading: boolean;
}

const EmptyContent = (props: EmptyContentProps) => {
const EmptyContent = () => {
// FIXME Update this link in the future
const linkLearnMoreAbout = 'https://access.redhat.com/articles/1586893';
const navigate = useNavigate();
Expand Down Expand Up @@ -277,7 +273,7 @@ const DefaultPage = () => {
const emptyContent = (
<>
<Header />
<EmptyContent isLoading={itemCount < 0} />
<EmptyContent />
</>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
@import '~@redhat-cloud-services/frontend-components-utilities/styles/variables';
import React from 'react';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { DetailGeneral } from './DetailGeneral';
import { AppContextProvider } from '../../../../AppContext';

test('expect sample-component to render children', () => {
render(
<AppContextProvider>
<DetailGeneral />
</AppContextProvider>
);
// expect(screen.getByRole('heading')).toHaveTextContent('Name');

Check failure on line 13 in src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.test.tsx

View workflow job for this annotation

GitHub Actions / validate

Insert `··`
// expect(screen.getByRole('heading')).toHaveTextContent('Location');

Check failure on line 14 in src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.test.tsx

View workflow job for this annotation

GitHub Actions / validate

Insert `··`
});
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
@import '~@redhat-cloud-services/frontend-components-utilities/styles/variables';
import React from 'react';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { DetailServers } from './DetailServers';

test('expect sample-component to render children', () => {
render(<DetailServers />);
// expect(screen.getByRole('heading')).toHaveTextContent('Name');

Check failure on line 8 in src/Routes/DetailPage/Components/DetailServers/DetailServers.test.tsx

View workflow job for this annotation

GitHub Actions / validate

Insert `··`
// expect(screen.getByRole('heading')).toHaveTextContent('Location');

Check failure on line 9 in src/Routes/DetailPage/Components/DetailServers/DetailServers.test.tsx

View workflow job for this annotation

GitHub Actions / validate

Insert `··`
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Flex, FlexItem, Stack, StackItem, TextInputGroupUtilities } from '@patternfly/react-core';
import { Flex, FlexItem, Stack, StackItem } from '@patternfly/react-core';
import React from 'react';
import { Domain } from '../../../../Api';
import { TableComposable, Tbody, Th, Thead, Tr } from '@patternfly/react-table';
import { InputFilterServer } from '../FilterField/filter-field';

interface DetailServersProps {
domain?: Domain;
Expand All @@ -21,12 +22,12 @@ export const DetailServers = (props: DetailServersProps) => {
<StackItem>
<Flex>
<FlexItem>
<TextInputGroupUtilities></TextInputGroupUtilities>
<InputFilterServer />
</FlexItem>
</Flex>
</StackItem>
<StackItem>
<TableComposable aria-label="Simple table" variant="compact" borders={false} className="pt-u-width-100">
<TableComposable aria-label="Simple table" variant="compact" borders={true} className="pt-u-width-100">
<Thead>
<Tr>
<Th>Name</Th>
Expand Down

0 comments on commit 88c8f92

Please sign in to comment.