Skip to content

Commit 3268c2a

Browse files
Added edge case for re-enabling source on the MC settings page (#2132)
* added edge case for re-enabling source on the MC settings page Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com> * added another test case for this scenario Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com> --------- Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com>
1 parent ef24e65 commit 3268c2a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

clients/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/modelCatalogSettings/modelCatalogSettings.cy.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,20 @@ describe('Catalog Source Configs Table', () => {
469469
row.shouldHaveValidationStatus('Starting');
470470
});
471471

472+
it('should show "Starting" status when re-enabling source (enabled=true but status=disabled)', () => {
473+
const reenablingSource = mockCatalogSource({
474+
id: 'hf-google',
475+
name: 'HuggingFace Google',
476+
status: 'disabled',
477+
});
478+
setupMocks([reenablingSource], { catalogs: [huggingFaceSource] }); // huggingFaceSource has enabled=true
479+
modelCatalogSettings.visit();
480+
const row = modelCatalogSettings.getRow('HuggingFace Google');
481+
row.findName().should('be.visible');
482+
row.shouldHaveValidationStatus('Starting');
483+
row.findValidationStatus().findByTestId('source-status-starting-hf-google').should('exist');
484+
});
485+
472486
it('should show "Failed" status with error message for error sources', () => {
473487
const errorSource = mockCatalogSource({
474488
id: 'hf-google',

clients/ui/frontend/src/app/pages/modelCatalogSettings/components/CatalogSourceStatus.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ const CatalogSourceStatus: React.FC<CatalogSourceStatusProps> = ({ catalogSource
9999
}
100100

101101
case CatalogSourceStatusEnum.DISABLED:
102-
return <>-</>;
103-
102+
// If we reach here, config.enabled is true - line 24
103+
// But status is still DISABLED, so show "Starting" (re-enable case)
104+
return startingOrUnknownLabel;
104105
default:
105106
return startingOrUnknownLabel;
106107
}

0 commit comments

Comments
 (0)