-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into migrate-angular-mui-mdc-components-update…
…d to reduce difference, adding new documentation, LinkAction block but with packages from Angular branch chosen.
- Loading branch information
Showing
29 changed files
with
1,120 additions
and
267 deletions.
There are no files selected for viewing
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,36 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Bug description** | ||
<!-- A clear and concise description of what the bug is. --> | ||
|
||
<!-- Screenshot and / or short video can be really helpful in understanding the issue, especially for dynamic or interactive bugs. --> | ||
|
||
**Reproduction steps** | ||
<!-- Provide steps to reproduce the behaviour, e.g: --> | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behaviour** | ||
<!-- Explain clearly and simply what you expected to happen instead of the bug. --> | ||
|
||
**Flow Configuration** <!-- To help diagnose issues with Flows, the flow's JSON configuration or a shared link to the Flow makes it easier to replicate and understand the issue. For ways to share flows see: https://kendraio-app.readthedocs.io/en/latest/workflow/sharing.html --> | ||
|
||
**Runtime environment** | ||
- OS: <!-- [e.g. Ubuntu] --> | ||
- Browser: <!-- [e.g. Firefox 123, Chrome 45, Safari 67] --> | ||
- App version: | ||
- Angular Version: <!-- (if known) --> | ||
|
||
**Additional context** | ||
<!--Add any other context about the problem here. --> | ||
|
||
<!--- Please check for label tags that match the issue type, e.g., use 'state' tag for state reactivity bugs. --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import { loadFlowCode } from '../support/helper'; | ||
|
||
/// <reference types="Cypress" /> | ||
|
||
|
||
describe('Actions block type', () => { | ||
it('should display a button with label, id and default color', () => { | ||
|
||
loadFlowCode([ | ||
{ | ||
"type": "actions", | ||
"buttons": [ | ||
{ | ||
"label": "OK", | ||
"color": "primary", | ||
"id": "button-primary", | ||
"blocks": [ | ||
{ | ||
"type": "dispatch", | ||
"action": "resetApp" | ||
} | ||
] | ||
}, | ||
{ | ||
"label": "Cancel", | ||
"id": "button-cancel", | ||
"blocks": [ | ||
{ | ||
"type": "init" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]); | ||
cy.get("#button-primary").should('exist'); | ||
cy.get("#button-primary").contains('OK'); | ||
cy.get("#button-primary").should('have.attr', 'ng-reflect-color', 'primary'); | ||
cy.get("#button-cancel").should('exist'); | ||
cy.get("#button-cancel").contains('Cancel'); | ||
}); | ||
|
||
it('should display a disabled button', () => { | ||
loadFlowCode([ | ||
{ | ||
"type": "actions", | ||
"buttons": [ | ||
{ | ||
"label": "Disabled", | ||
"id": "button-disabled", | ||
"blocks": [], | ||
"enabledGetter": false | ||
} | ||
] | ||
} | ||
]); | ||
cy.get("#button-disabled").should('exist'); | ||
cy.get("#button-disabled").should('have.attr', 'ng-reflect-disabled'); | ||
}); | ||
}); | ||
|
||
|
||
describe('LinkActionComponent', () => { | ||
it('should generate the correct link URL from plain strings', () => { | ||
// Tests with hardcoded values | ||
loadFlowCode([ | ||
{ | ||
"type": "link-action", | ||
"label": "Test Link", | ||
"adapterName": "myAdapter", | ||
"workflowId": "myWorkflow" | ||
} | ||
]); | ||
cy.get('app-link-action a').should('have.attr', 'href', '/myAdapter/myWorkflow'); | ||
}); | ||
|
||
it('should generate the correct link URL using object mappings', () => { | ||
// Test with JMESPath expressions | ||
loadFlowCode([ | ||
{ | ||
"type": "mapping", | ||
"mapping": "{ adapter: `testAdapter`, workflow: `testWorkflow` }" | ||
}, | ||
{ | ||
"type": "link-action", | ||
"label": "Dynamic Link", | ||
"adapterNameGetter": "data.adapter", | ||
"workflowIdGetter": "data.workflow" | ||
} | ||
]); | ||
cy.get('app-link-action a').should('have.attr', 'href', '/testAdapter/testWorkflow'); | ||
}); | ||
|
||
it('should not have no link target by default', () => { | ||
// The default behavior should be to open the link in the same tab, | ||
// it's up to the user and their user-agent to decide how to handle the link. | ||
loadFlowCode([ | ||
{ | ||
"type": "link-action", | ||
"label": "Test Link", | ||
"adapterName": "myAdapter", | ||
"workflowId": "myWorkflow" | ||
} | ||
]); | ||
cy.get('app-link-action a').should('not.have.attr', 'target'); | ||
}); | ||
|
||
}); |
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
Oops, something went wrong.