Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix display of waiting string in pod resource tab #2625

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const TaskRunDetails = ({ onViewChange, pod, task, taskRun, view, showIO }) => {
const [podContent, setPodContent] = useState();
const hasEvents = pod?.events?.length > 0;

const podResource = { ...pod?.resource };
const podResource =
typeof pod?.resource === 'string' ? pod.resource : { ...pod?.resource };
if (podResource?.metadata?.managedFields) {
delete podResource.metadata.managedFields;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ describe('TaskRunDetails', () => {
expect(queryByText('Events')).toBeFalsy();
});

it('renders pod waiting state', () => {
const waitingMessage = 'waiting for pod';
const taskRun = {
metadata: { name: 'task-run-name' },
spec: {},
status: {}
};
const { queryByText } = render(
<TaskRunDetails
pod={{
resource: waitingMessage
}}
task={{
metadata: 'task',
spec: {}
}}
taskRun={taskRun}
view="pod"
/>
);
expect(queryByText('Pod')).toBeTruthy();
expect(queryByText('Resource')).toBeFalsy();
expect(queryByText(waitingMessage)).toBeTruthy();
});

it('renders both input and output resources', () => {
const inputResourceName = 'input-resource';
const outputResourceName = 'output-resource';
Expand Down