From de225a907f56477b767eae81134154e0398a3bf0 Mon Sep 17 00:00:00 2001
From: Carlos Lizaga <carlos.lizaga@pronovias.com>
Date: Fri, 24 Nov 2017 17:24:15 +0100
Subject: [PATCH] Backend jquery-ui version has a diferent behavior on create
 that will add ui-dialog-titlebar anyway. This test is only valid with
 frontend's version @TODO: Re-design Jasmine settings to match a selective
 architecture for testing in order to split them.

---
 .../jasmine/tests/lib/mage/dropdown.test.js   | 39 +++++++++++--------
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/dev/tests/js/jasmine/tests/lib/mage/dropdown.test.js b/dev/tests/js/jasmine/tests/lib/mage/dropdown.test.js
index 70e608d5bfe..1034ad263d9 100644
--- a/dev/tests/js/jasmine/tests/lib/mage/dropdown.test.js
+++ b/dev/tests/js/jasmine/tests/lib/mage/dropdown.test.js
@@ -270,29 +270,34 @@ define([
             jasmine.clock().uninstall();
         });
 
-        it('check if the title bar is prevented from being created', function () {
-            var dialog = $('<div/>'),
-                uiClass = '.ui-dialog',
-                ui;
+        // Backend jquery-ui version has a diferent behavior on create that will add ui-dialog-titlebar anyway.
+        // This test is only valid with frontend's version
+        // @TODO: Re-design Jasmine settings to match a selective architecture for testing in order to split them.
+        if ($.ui.version !== '1.9.2') {
+            it('check if the title bar is prevented from being created', function () {
+                var dialog = $('<div/>'),
+                    uiClass = '.ui-dialog',
+                    ui;
 
-            dialog.dropdownDialog({
-                'createTitleBar': true
-            });
+                dialog.dropdownDialog({
+                    'createTitleBar': true
+                });
 
-            ui = $(uiClass);
-            expect(ui.find('.ui-dialog-titlebar').length > 0).toBeTruthy();
+                ui = $(uiClass);
+                expect(ui.find('.ui-dialog-titlebar').length > 0).toBeTruthy();
 
-            dialog.dropdownDialog('destroy');
+                dialog.dropdownDialog('destroy');
 
-            dialog.dropdownDialog({
-                'createTitleBar': false
-            });
+                dialog.dropdownDialog({
+                    'createTitleBar': false
+                });
 
-            ui = $(uiClass);
-            expect(ui.find('.ui-dialog-titlebar').length <= 0).toBeTruthy();
+                ui = $(uiClass);
+                expect(ui.find('.ui-dialog-titlebar').length <= 0).toBeTruthy();
 
-            dialog.dropdownDialog('destroy');
-        });
+                dialog.dropdownDialog('destroy');
+            });
+        }
 
         it('check if the position function gets disabled', function () {
             var dialog = $('<div/>'),
-- 
GitLab