Skip to content

Commit

Permalink
fixed DI cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaileshParmar11 committed Nov 9, 2023
1 parent 84e4bb3 commit 19f2268
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('Data Insight feature', () => {
interceptURL('GET', '/api/v1/apps?limit=*', 'apps');
interceptURL(
'GET',
'/api/v1/apps/name/DataInsightsApplication?fields=owner,pipelines',
'/api/v1/apps/name/DataInsightsApplication?*',
'dataInsightsApplication'
);
interceptURL(
Expand All @@ -128,7 +128,7 @@ describe('Data Insight feature', () => {
cy.get('[data-menu-id*="integrations.apps"]').scrollIntoView().click();
verifyResponseStatusCode('@apps', 200);
cy.get(
'[data-testid="data-insights-card"] [data-testid="config-btn"]'
'[data-testid="data-insights-application-card"] [data-testid="config-btn"]'
).click();
verifyResponseStatusCode('@dataInsightsApplication', 200);
cy.get('[data-testid="deploy-button"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Data Insight settings page should work properly', () => {
'triggerPipeline'
);
cy.get(
'[data-testid="data-insights-card"] [data-testid="config-btn"]'
'[data-testid="data-insights-application-card"] [data-testid="config-btn"]'
).click();
verifyResponseStatusCode('@getDataInsightDetails', 200);
cy.get('[data-testid="deploy-button"]').click();
Expand All @@ -67,7 +67,7 @@ describe('Data Insight settings page should work properly', () => {
);
interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication');
cy.get(
'[data-testid="data-insights-card"] [data-testid="config-btn"]'
'[data-testid="data-insights-application-card"] [data-testid="config-btn"]'
).click();
verifyResponseStatusCode('@getDataInsightDetails', 200);
cy.get('[data-testid="edit-button"]').click();
Expand All @@ -93,24 +93,26 @@ describe('Data Insight settings page should work properly', () => {
'deleteApplication'
);
cy.get(
'[data-testid="data-insights-card"] [data-testid="config-btn"]'
'[data-testid="data-insights-application-card"] [data-testid="config-btn"]'
).click();
verifyResponseStatusCode('@getDataInsightDetails', 200);
cy.get('[data-testid="manage-button"]').click();
cy.get('[data-testid="uninstall-button-title"]').click();
cy.get('[data-testid="save-button"]').click();
verifyResponseStatusCode('@deleteApplication', 200);
verifyResponseStatusCode('@getApplications', 200);
cy.get('[data-testid="data-insights-card"]').should('not.exist');
cy.get('[data-testid="data-insights-application-card"]').should(
'not.exist'
);
});

it('Install application', () => {
interceptURL('GET', '/api/v1/apps/marketplace?limit=*', 'getMarketPlace');
interceptURL('POST', '/api/v1/apps/install', 'installApplication');
interceptURL('POST', '/api/v1/apps', 'installApplication');
cy.get('[data-testid="add-application"]').click();
verifyResponseStatusCode('@getMarketPlace', 200);
cy.get(
'[data-testid="data-insights-card"] [data-testid="config-btn"]'
'[data-testid="data-insights-application-card"] [data-testid="config-btn"]'
).click();
cy.get('[data-testid="install-application"]').click();
cy.get('[data-testid="save-button"]').click();
Expand All @@ -119,6 +121,8 @@ describe('Data Insight settings page should work properly', () => {
cy.get('[data-testid="deploy-button"]').click();
verifyResponseStatusCode('@installApplication', 201);
verifyResponseStatusCode('@getApplications', 200);
cy.get('[data-testid="data-insights-card"]').should('be.visible');
cy.get('[data-testid="data-insights-application-card"]').should(
'be.visible'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ApplicationCard = ({
className,
'application-card card-body-border-none'
)}
data-testid={`${kebabCase(title)}-card`}>
data-testid={`${kebabCase(appName)}-card`}>
<div className="d-flex items-center gap-3">
<div className="application-logo">
<AppLogo appName={appName} />
Expand Down

0 comments on commit 19f2268

Please sign in to comment.