-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(902): Route and Kamelet container name issue
- Loading branch information
Shivam Gupta
committed
Apr 4, 2024
1 parent
6e4d06d
commit 7e9b444
Showing
9 changed files
with
642 additions
and
134 deletions.
There are no files selected for viewing
330 changes: 219 additions & 111 deletions
330
packages/ui/src/components/Visualization/Canvas/CanvasForm.test.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
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
296 changes: 284 additions & 12 deletions
296
packages/ui/src/components/Visualization/Canvas/__snapshots__/CanvasForm.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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
59 changes: 59 additions & 0 deletions
59
packages/ui/src/models/visualization/flows/support/flows-visibility.test.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,59 @@ | ||
import { VisualFlowsApi } from './flows-visibility'; | ||
|
||
describe('VisualFlowsApi', () => { | ||
let dispatch: jest.Mock; | ||
let visualFlowsApi: VisualFlowsApi; | ||
|
||
beforeEach(() => { | ||
dispatch = jest.fn(); | ||
visualFlowsApi = new VisualFlowsApi(dispatch); | ||
}); | ||
|
||
it('should toggle flow visibility', () => { | ||
visualFlowsApi.toggleFlowVisible('flowId'); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'toggleFlowVisible', flowId: 'flowId', isVisible: undefined }); | ||
}); | ||
|
||
it('should toggle flow visibility with a given flag', () => { | ||
visualFlowsApi.toggleFlowVisible('flowId', true); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'toggleFlowVisible', flowId: 'flowId', isVisible: true }); | ||
}); | ||
|
||
it('should show all flows', () => { | ||
visualFlowsApi.showAllFlows(); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'showAllFlows' }); | ||
}); | ||
|
||
it('should hide all flows', () => { | ||
visualFlowsApi.hideAllFlows(); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'hideAllFlows' }); | ||
}); | ||
|
||
it('should set visible flows', () => { | ||
visualFlowsApi.setVisibleFlows(['flowId']); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'setVisibleFlows', flows: ['flowId'] }); | ||
}); | ||
|
||
it('should clear flows', () => { | ||
visualFlowsApi.clearFlows(); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'clearFlows' }); | ||
}); | ||
|
||
it('should init visible flows', () => { | ||
visualFlowsApi.initVisibleFlows({ flowId: true }); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'initVisibleFlows', visibleFlows: { flowId: true } }); | ||
}); | ||
|
||
it('should rename flow', () => { | ||
visualFlowsApi.renameFlow('flowId', 'newName'); | ||
|
||
expect(dispatch).toHaveBeenCalledWith({ type: 'renameFlow', flowId: 'flowId', newName: 'newName' }); | ||
}); | ||
}); |
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