Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkrumbach07 committed Oct 16, 2024
1 parent 5c9e35c commit 2c2d0c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('NotebookServer', () => {
notebookSizeName: 'XSmall',
imageName: 'code-server-notebook',
imageTagName: '2023.2',
acceleratorProfile: { acceleratorProfiles: [], count: 0, unknownProfileDetected: false },
acceleratorProfile: { count: 0, unknownProfileDetected: false },
envVars: { configMap: {}, secrets: {} },
state: 'started',
storageClassName: 'openshift-default-sc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ type ServingRuntimeDetailsProps = {

const ServingRuntimeDetails: React.FC<ServingRuntimeDetailsProps> = ({ obj, isvc }) => {
const { dashboardConfig } = React.useContext(AppContext);
const { formData: acceleratorProfileFormData, initialState: initialAcceleratorProfileState } =
useServingAcceleratorProfileForm(obj, isvc);
const { initialState: initialAcceleratorProfileState } = useServingAcceleratorProfileForm(
obj,
isvc,
);
const enabledAcceleratorProfiles = initialAcceleratorProfileState.acceleratorProfiles.filter(
(ac) => ac.spec.enabled,
);
Expand Down Expand Up @@ -58,9 +60,9 @@ const ServingRuntimeDetails: React.FC<ServingRuntimeDetailsProps> = ({ obj, isvc
<DescriptionListGroup>
<DescriptionListTerm>Accelerator</DescriptionListTerm>
<DescriptionListDescription>
{acceleratorProfileFormData.profile
? `${acceleratorProfileFormData.profile.spec.displayName}${
!acceleratorProfileFormData.profile.spec.enabled ? ' (disabled)' : ''
{initialAcceleratorProfileState.acceleratorProfile
? `${initialAcceleratorProfileState.acceleratorProfile.spec.displayName}${
!initialAcceleratorProfileState.acceleratorProfile.spec.enabled ? ' (disabled)' : ''
}`
: enabledAcceleratorProfiles.length === 0
? 'No accelerator enabled'
Expand All @@ -70,11 +72,11 @@ const ServingRuntimeDetails: React.FC<ServingRuntimeDetailsProps> = ({ obj, isvc
</DescriptionListDescription>
</DescriptionListGroup>
{!initialAcceleratorProfileState.unknownProfileDetected &&
acceleratorProfileFormData.profile && (
initialAcceleratorProfileState.acceleratorProfile && (
<DescriptionListGroup>
<DescriptionListTerm>Number of accelerators</DescriptionListTerm>
<DescriptionListDescription>
{acceleratorProfileFormData.count}
{initialAcceleratorProfileState.count}
</DescriptionListDescription>
</DescriptionListGroup>
)}
Expand Down

0 comments on commit 2c2d0c8

Please sign in to comment.