/ui5-bindingPath-testcases-extended

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Purpose

Extended test case for sap/ui/test/matchers/BindingPath since the orinial test cases located in BindinPath.qunit.js are not sufficient.

The 'extended custom test cases' depict a bug in the BindingPath matcher when modelName is set and the bound propertyPath is a root property.

More information

This test case example is based on the 'openui5-basic-template-app'.

Prerequisites

The UI5 build and development tooling command line interface (UI5 CLI) has to be installed. For installation instructions please see Installing the UI5 CLI.

Setup

  1. Clone the repository and navigate into it
  2. Install all dependencies
    npm install

Execute Test

  1. Start a local server
    npm start
  2. Open tespage and run the unit test page
  3. Note the failed test case no. 4. and 6 and the successfull test case no. 5.

Debugging Information

The function

function _getFormattedPath(sPath, bWithNamedModel, bWithContext)

in sap/ui/test/matchers/BindingPath does substring(1) for all cases when the model is a named model and the path starts with a '/'. The needed workaround is a leading double slash in case the property is a model root property.