{"size": 1086, "ext": "js", "max_stars_repo_path": "src/sap.ui.dt/test/sap/ui/dt/qunit/ElementOverlayRTL.qunit.js", "max_stars_repo_name": "annikarossel/openui5orgpage", "max_stars_repo_stars_event_min_datetime": "2018-04-17T23:58:33.000Z", "max_stars_repo_stars_event_max_datetime": "2018-04-17T23:58:33.000Z", "max_issues_repo_path": "src/sap.ui.dt/test/sap/ui/dt/qunit/ElementOverlayRTL.qunit.js", "max_issues_repo_name": "annikarossel/openui5orgpage", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/sap.ui.dt/test/sap/ui/dt/qunit/ElementOverlayRTL.qunit.js", "max_forks_repo_name": "annikarossel/openui5orgpage", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.8846153846, "max_line_length": 73, "alphanum_fraction": 0.6436464088}
/* global QUnit */

QUnit.config.autostart = false;

sap.ui.require([
	// internal
	"sap/ui/dt/ElementOverlay",
	// external
	"sap/m/Button"
], function(
	ElementOverlay,
	Button
) {
	'use strict';

	QUnit.module("Given that an Overlay Container is created on RTL mode", {
		beforeEach : function(assert) {
			var fnDone = assert.async();
			this.oButton = new Button({
				text : "Button"
			});

			this.oButton.placeAt("content");
			sap.ui.getCore().applyChanges();

			this.oOverlay = new ElementOverlay({
				element : this.oButton,
				isRoot: true,
				designTimeMetadata : {}
			});
			this.oOverlay.attachEventOnce("init", function() {
				this.oOverlay.placeInOverlayContainer();
				this.oOverlay.applyStyles();
				fnDone();
			}.bind(this));
		},
		afterEach : function() {
			this.oButton.destroy();
		}
	});

	QUnit.test("then", function(assert) {
		// Math.ceil is required for IE and Edge
		assert.deepEqual(
			Math.ceil(this.oOverlay.$().offset()),
			Math.ceil(this.oButton.$().offset()),
			"overlay has same position as the control"
		);
	});

	QUnit.start();
});