-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable edit for kn svc created via cli and edit route option
- Loading branch information
1 parent
6e7c07a
commit bcdd445
Showing
7 changed files
with
163 additions
and
14 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
frontend/packages/dev-console/src/actions/__tests__/modify-application.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { DeploymentModel } from '@console/internal/models'; | ||
import { ServiceModel } from '@console/knative-plugin'; | ||
import { knativeServiceObj } from '@console/dev-console/src/components/topology/__tests__/topology-knative-test-data'; | ||
import { sampleDeployments } from '@console/dev-console/src/components/topology/__tests__/topology-test-data'; | ||
import { EditApplication } from '../modify-application'; | ||
|
||
describe('modify application edit flow', () => { | ||
it('expect EditApplication to return hidden false for knative service without annotations', () => { | ||
const editAppData = EditApplication(ServiceModel, knativeServiceObj); | ||
expect(editAppData.hidden).toBe(false); | ||
}); | ||
|
||
it('expect EditApplication to return hidden false for knative service with annotations', () => { | ||
const knativeServiceObjWithAnnoations = { | ||
...knativeServiceObj, | ||
metadata: { | ||
...knativeServiceObj.metadata, | ||
annotations: { | ||
'openshift.io/generated-by': 'OpenShiftWebConsole', | ||
}, | ||
}, | ||
}; | ||
const editAppData = EditApplication(ServiceModel, knativeServiceObjWithAnnoations); | ||
expect(editAppData.hidden).toBe(false); | ||
}); | ||
|
||
it('expect EditApplication to return hidden true for Deployments without annotations', () => { | ||
const editAppData = EditApplication(DeploymentModel, sampleDeployments.data[0]); | ||
expect(editAppData.hidden).toBe(true); | ||
}); | ||
|
||
it('expect EditApplication to return hidden false for Deployments with annotations', () => { | ||
const sampleDeploymentWithAnnoations = { | ||
...sampleDeployments.data[0], | ||
metadata: { | ||
...sampleDeployments.data[0].metadata, | ||
annotations: { | ||
'openshift.io/generated-by': 'OpenShiftWebConsole', | ||
}, | ||
}, | ||
}; | ||
const editAppData = EditApplication(DeploymentModel, sampleDeploymentWithAnnoations); | ||
expect(editAppData.hidden).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters