{"size": 1974, "ext": "js", "max_stars_repo_path": "sapui5-sdk-1.74.0/test-resources/sap/suite/ui/generic/template/qunit/js/AnnotationHelper-getBindingForHiddenPath.js", "max_stars_repo_name": "juanfelipe82193/opensap", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "sapui5-sdk-1.74.0/test-resources/sap/suite/ui/generic/template/qunit/js/AnnotationHelper-getBindingForHiddenPath.js", "max_issues_repo_name": "juanfelipe82193/opensap", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sapui5-sdk-1.74.0/test-resources/sap/suite/ui/generic/template/qunit/js/AnnotationHelper-getBindingForHiddenPath.js", "max_forks_repo_name": "juanfelipe82193/opensap", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.84375, "max_line_length": 89, "alphanum_fraction": 0.6995947315}
sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper"],
	function (AnnotationHelper) {
		module("Test methods to check funtion getBindingForHiddenPath", {

			setup: function () {
				this.oAnnotationHelper = AnnotationHelper;
			},

			teardown: function () {
				this.oAnnotationHelper = null;
			}
		});

		test("Hidden annotation contains Path", function () {
			var oAnnotationHelper = this.oAnnotationHelper;
			var oHidden = {
				"com.sap.vocabularies.UI.v1.Hidden": {
					"Path": "Edit_ac"
				}
			};

			var bExpectedExpression = "{= !${Edit_ac} }";
			var bExpression = oAnnotationHelper.getBindingForHiddenPath(oHidden);
			equals(bExpression, bExpectedExpression, "Expected value is: " + bExpectedExpression);
		});

		test("Hidden annotation contains Bool:false", function () {
			var oAnnotationHelper = this.oAnnotationHelper;
			var oHidden = {
				"com.sap.vocabularies.UI.v1.Hidden": {
					"Bool": "false"
				}
			};

			var bExpectedExpression = true;
			var bExpression = oAnnotationHelper.getBindingForHiddenPath(oHidden);
			equals(bExpression, bExpectedExpression, "Expected value is: " + bExpectedExpression);
		});

		test("Hidden annotation contains Bool:true", function () {
			var oAnnotationHelper = this.oAnnotationHelper;
			var oHidden = {
				"com.sap.vocabularies.UI.v1.Hidden": {
					"Bool": "true"
				}
			};

			var bExpectedExpression = false;
			var bExpression = oAnnotationHelper.getBindingForHiddenPath(oHidden);
			equals(bExpression, bExpectedExpression, "Expected value is: " + bExpectedExpression);
		});

		test("Hidden annotation does not contain Bool or Path", function () {
			var oAnnotationHelper = this.oAnnotationHelper;
			var oHidden = {
				"com.sap.vocabularies.UI.v1.Hidden": {}
			};

			var bExpectedExpression = false;
			var bExpression = oAnnotationHelper.getBindingForHiddenPath(oHidden);
			equals(bExpression, bExpectedExpression, "Expected value is: " + bExpectedExpression);
		});
});
