-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions button disabled instead of hidden (#434)
* actions button disabled instead of hidden * fix test, update documentation * add test for actions block
- Loading branch information
1 parent
34c4fc5
commit 26d0655
Showing
4 changed files
with
180 additions
and
27 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,61 @@ | ||
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'); | ||
}); | ||
}); | ||
|
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