File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
test/e2e-cypress/tests/bugs Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ export default class Execute extends Component {
2222 this . props . onExecute ( )
2323 }
2424 specActions . execute ( { operation, path, method } )
25+ } else {
26+ // deferred by 40ms, to give element class change time to settle.
27+ specActions . clearValidateParams ( [ path , method ] )
28+ setTimeout ( ( ) => {
29+ specActions . validateParams ( [ path , method ] )
30+ } , 40 )
2531 }
2632 }
2733
Original file line number Diff line number Diff line change @@ -118,9 +118,7 @@ export default class OperationContainer extends PureComponent {
118118 }
119119
120120 onTryoutClick = ( ) => {
121- let { specActions, path, method } = this . props
122121 this . setState ( { tryItOutEnabled : ! this . state . tryItOutEnabled } )
123- specActions . clearValidateParams ( [ path , method ] )
124122 }
125123
126124 onExecute = ( ) => {
Original file line number Diff line number Diff line change 1+ describe ( "#5070: Required field not highlighted on click of Execute button (second time)" , ( ) => {
2+ it ( "should not clear error class=invalid on input field (Swagger)" , ( ) => {
3+ cy
4+ . visit ( "/?url=/documents/petstore.swagger.yaml" )
5+ . get ( "#operations-pet-getPetById" )
6+ . click ( )
7+ // Expand Try It Out
8+ . get ( ".try-out__btn" )
9+ . click ( )
10+ // Execute without user input
11+ . get ( ".execute.opblock-control__btn" )
12+ . click ( )
13+ . get ( ".parameters-col_description input" )
14+ . should ( $el => {
15+ expect ( $el ) . to . have . length ( 1 )
16+ const className = $el [ 0 ] . className
17+ expect ( className ) . to . match ( / i n v a l i d / i)
18+ } )
19+ // Cancel Try It Out
20+ . get ( ".cancel" )
21+ . click ( )
22+ // Expand Try It Out (Again)
23+ . get ( ".try-out__btn" )
24+ . click ( )
25+ . get ( ".parameters-col_description input" )
26+ . should ( $el => {
27+ expect ( $el ) . to . have . length ( 1 )
28+ const className = $el [ 0 ] . className
29+ expect ( className ) . to . match ( / i n v a l i d / i)
30+ } )
31+ } )
32+ } )
You can’t perform that action at this time.
0 commit comments