Skip to content

Commit

Permalink
Minor: fixed log viewer ui breaking issue (open-metadata#16337)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaileshParmar11 authored May 17, 2024
1 parent 5473e32 commit 8116fec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ const AppLogsViewer = ({ data }: AppLogsViewerProps) => {

return (
<>
{successContext?.stats && statsRender(successContext?.stats.jobStats)}
{failureContext?.stats && statsRender(failureContext?.stats.jobStats)}
{successContext?.stats?.jobStats &&
statsRender(successContext?.stats.jobStats)}
{failureContext?.stats?.jobStats &&
statsRender(failureContext?.stats.jobStats)}

{successContext?.stats?.entityStats &&
entityStatsRenderer(successContext.stats.entityStats)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ const mockProps5 = {
},
};

const mockProps6 = {
data: {
...mockProps1.data,
successContext: {
stats: {},
},
failureContext: {
failure: {
message: 'Reindexing Job Has Encountered an Exception.',
errorSource: 'Job',
failedEntities: [],
},
},
},
};

describe('AppLogsViewer component', () => {
it('should contain all necessary elements', () => {
render(<AppLogsViewer {...mockProps1} />);
Expand Down Expand Up @@ -232,4 +248,16 @@ describe('AppLogsViewer component', () => {
screen.queryByTestId('app-entity-stats-history-table')
).not.toBeInTheDocument();
});

it('should render failedContext data', async () => {
render(<AppLogsViewer {...mockProps6} />);

expect(screen.queryByTestId('stats-component')).not.toBeInTheDocument();

expect(
screen.queryByTestId('app-entity-stats-history-table')
).not.toBeInTheDocument();

expect(await screen.findByTestId('lazy-log')).toBeInTheDocument();
});
});

0 comments on commit 8116fec

Please sign in to comment.