|
|
|
@ -11,8 +11,9 @@ describe("DateInterval", function () {
|
|
|
|
|
*/ |
|
|
|
|
it("DateInterval_defaultValue", function () { |
|
|
|
|
var dateInterval = BI.Test.createWidget({ |
|
|
|
|
type: "bi.date_interval", |
|
|
|
|
value: { |
|
|
|
|
type: "bi.date_interval" |
|
|
|
|
}); |
|
|
|
|
dateInterval.setValue({ |
|
|
|
|
start: { |
|
|
|
|
type: 1, |
|
|
|
|
value: { |
|
|
|
@ -28,12 +29,53 @@ describe("DateInterval", function () {
|
|
|
|
|
position: 2 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
expect(dateInterval.element.find(".bi-date-trigger .bi-label").text()).to.equal("2018-01-122019-01-01"); |
|
|
|
|
dateInterval.destroy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* test_author_windy |
|
|
|
|
*/ |
|
|
|
|
it("DateInterval_测试报错", function (done) { |
|
|
|
|
var testText; |
|
|
|
|
var dateInterval = BI.Test.createWidget({ |
|
|
|
|
type: "bi.date_interval", |
|
|
|
|
value: { |
|
|
|
|
start: { |
|
|
|
|
type: 2, |
|
|
|
|
value: { |
|
|
|
|
year: -1, |
|
|
|
|
position: 2 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
end: { |
|
|
|
|
type: 1, |
|
|
|
|
value: { |
|
|
|
|
year: 2018, |
|
|
|
|
month: 1, |
|
|
|
|
day: 12 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: "EVENT_ERROR", |
|
|
|
|
action: function () { |
|
|
|
|
testText = "ERROR"; |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
BI.nextTick(function () { |
|
|
|
|
dateInterval.element.find(".first-element .bi-date-trigger .bi-basic-button").click(); |
|
|
|
|
BI.delay(function () { |
|
|
|
|
dateInterval.element.find(".first-element .bi-text-button:contains(确定)").click(); |
|
|
|
|
expect(testText).to.equal("ERROR"); |
|
|
|
|
dateInterval.destroy(); |
|
|
|
|
done(); |
|
|
|
|
}, 300); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* test_author_windy |
|
|
|
|
*/ |
|
|
|
@ -98,4 +140,46 @@ describe("DateInterval", function () {
|
|
|
|
|
}); |
|
|
|
|
dateInterval.destroy(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* test_author_windy |
|
|
|
|
*/ |
|
|
|
|
it("TimeInterval_测试报错", function (done) { |
|
|
|
|
var testText; |
|
|
|
|
var dateInterval = BI.Test.createWidget({ |
|
|
|
|
type: "bi.time_interval", |
|
|
|
|
value: { |
|
|
|
|
start: { |
|
|
|
|
type: 2, |
|
|
|
|
value: { |
|
|
|
|
year: -1, |
|
|
|
|
position: 2 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
end: { |
|
|
|
|
type: 1, |
|
|
|
|
value: { |
|
|
|
|
year: 2018, |
|
|
|
|
month: 1, |
|
|
|
|
day: 12 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: "EVENT_ERROR", |
|
|
|
|
action: function () { |
|
|
|
|
testText = "ERROR"; |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
BI.nextTick(function () { |
|
|
|
|
dateInterval.element.find(".first-element .bi-date-time-trigger .bi-basic-button").click(); |
|
|
|
|
BI.delay(function () { |
|
|
|
|
dateInterval.element.find(".first-element .bi-text-button:contains(确定)").click(); |
|
|
|
|
expect(testText).to.equal("ERROR"); |
|
|
|
|
dateInterval.destroy(); |
|
|
|
|
done(); |
|
|
|
|
}, 300); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |