Skip to content

Commit

Permalink
fix: fix cypress tests
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar committed Dec 19, 2024
1 parent 55a9d5d commit ab3d856
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { asProjectAdminUser } from '~/__tests__/cypress/cypress/utils/mockUsers'
import { NamespaceApplicationCase } from '~/pages/projects/types';
import { mockNimServingRuntimeTemplate } from '~/__mocks__/mockNimResource';
import { mockNimAccount } from '~/__mocks__/mockNimAccount';
import { mockOdhApplication } from '~/__mocks__/mockOdhApplication';

type HandlersProps = {
isEmpty?: boolean;
Expand Down Expand Up @@ -274,6 +275,17 @@ const initIntercepts = ({
buildMockPipelines(isEmpty ? [] : [mockPipelineKF({})]),
);

cy.interceptOdh('GET /api/components', null, [mockOdhApplication({})]);
cy.interceptOdh(
'GET /api/integrations/:internalRoute',
{ path: { internalRoute: 'nim' } },
{
isInstalled: true,
isEnabled: true,
canInstall: false,
error: '',
},
);
cy.interceptK8sList(NIMAccountModel, mockK8sResourceList([mockNimAccount({})]));
};

Expand Down
15 changes: 11 additions & 4 deletions frontend/src/__tests__/cypress/cypress/utils/nimUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,24 @@ export const initInterceptorsValidatingNimEnablement = (
{ path: { internalRoute: 'nim' } },
{
isInstalled: true,
isEnabled: true,
isEnabled: false,
canInstall: false,
error: '',
},
);
cy.interceptK8sList(NIMAccountModel, mockK8sResourceList([mockNimAccount({})]));

if (!disableServingRuntime) {
const templateMock = mockNimServingRuntimeTemplate();
cy.interceptK8sList(TemplateModel, mockK8sResourceList([templateMock]));
cy.interceptK8s(TemplateModel, templateMock);
cy.interceptOdh(
'GET /api/integrations/:internalRoute',
{ path: { internalRoute: 'nim' } },
{
isInstalled: true,
isEnabled: true,
canInstall: false,
error: '',
},
);
}

cy.interceptK8sList(
Expand Down

0 comments on commit ab3d856

Please sign in to comment.