Skip to Content
0

How to unit test sapui5 controls ?

Apr 26 at 06:47 PM

28

avatar image
Former Member

Hi All, I am trying to write a unit test for the following code. Please guide the appropriate approach. This code was in the controller and moved it into the utility file so we can reuse it. How can I stub aSearchFormControls and do some assertion test? How can I stub controls and pass them as parameters in method enableControls() where their property setEnabled set to true which later I can test with assertions test.

 aSearchFormControls = [
                this.byId("a"),
                this.byId("b"),
                this.byId("c"),
            ];
    enableControls: function enableControls(aSearchFormControls ) {
            aControls.forEach(function enable(oControl) {
                oControl.setEnabled(true);
            });
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers