From f533921be3a4e34a1a8b82e3b4ed39f280dbfa9f Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 16 Jan 2020 14:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=A2=E7=A7=8D=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8controller=E5=B1=82=E4=BF=AE=E6=94=B9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8E=A7=E5=88=B6title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/controller/controller.tooltips.js | 2 +- .../yearmonth/__test__/combo.yearmonth.test.js | 14 ++++++-------- .../yearquarter/__test__/combo.yearquarter.test.js | 14 ++++++-------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index 56d000329..13e6e7e07 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -65,7 +65,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { }); this.showingTips = {}; if (!this.has(name)) { - this.create(name, text, level, opt.container || context); + this.create(name, text, level, opt.container || "body"); } if (!opt.belowMouse) { var offset = context.element.offset(); diff --git a/src/widget/yearmonth/__test__/combo.yearmonth.test.js b/src/widget/yearmonth/__test__/combo.yearmonth.test.js index 08684f804..5f026b04b 100644 --- a/src/widget/yearmonth/__test__/combo.yearmonth.test.js +++ b/src/widget/yearmonth/__test__/combo.yearmonth.test.js @@ -97,14 +97,12 @@ describe("YearMonthCombo", function () { BI.nextTick(function () { dateCombo.element.find(".bi-year-month-trigger .bi-basic-button").click(); BI.nextTick(function () { - var input = dateCombo.element.find(".bi-year-month-trigger .bi-input"); - BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () { - BI.delay(function () { - expect(dateCombo.element.find(".bi-year-month-trigger + .bi-popup-view").css("display")).to.equal("none"); - dateCombo.destroy(); - done(); - }, 300); - }); + $("body").mousedown(); + BI.delay(function () { + expect(dateCombo.element.find(".bi-year-month-trigger + .bi-popup-view").css("display")).to.equal("none"); + dateCombo.destroy(); + done(); + }, 300); }) }); }); diff --git a/src/widget/yearquarter/__test__/combo.yearquarter.test.js b/src/widget/yearquarter/__test__/combo.yearquarter.test.js index 656847b5a..48555052f 100644 --- a/src/widget/yearquarter/__test__/combo.yearquarter.test.js +++ b/src/widget/yearquarter/__test__/combo.yearquarter.test.js @@ -97,14 +97,12 @@ describe("YearQuarterCombo", function () { BI.nextTick(function () { dateCombo.element.find(".bi-year-quarter-trigger .bi-basic-button").click(); BI.nextTick(function () { - var input = dateCombo.element.find(".bi-year-quarter-trigger .bi-input"); - BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () { - BI.delay(function () { - expect(dateCombo.element.find(".bi-year-quarter-trigger + .bi-popup-view").css("display")).to.equal("none"); - dateCombo.destroy(); - done(); - }, 300); - }); + $("body").mousedown(); + BI.delay(function () { + expect(dateCombo.element.find(".bi-year-quarter-trigger + .bi-popup-view").css("display")).to.equal("none"); + dateCombo.destroy(); + done(); + }, 300); }) }); });