Skip to content

Commit

Permalink
fix: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiocro committed Sep 18, 2015
1 parent ff59110 commit 8aa19c8
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions tests/integration/misc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,30 @@ test("test yield", function(assert) {
)
);

// initial render
//this.$();

assert.equal($('label.yieldholder').text(), "yield");

});


test("test the useCurrent option", function(assert) {
assert.expect(2);
var date;
this.on('handleDate', val => { assert.ok(val); });
this.render(hbs`{{bs-datetimepicker useCurrent=true showClear=true updateDate='handleDate'}}`);

andThen(function() {
click($(".input-group-addon"));
var handleDateCnt = 0;
this.on('handleDate', val => {
var cnt = ++handleDateCnt;
if(cnt === 1) {
assert.ok(val);
}
else if(cnt === 2) {
assert.equal(val, undefined);
}
});
this.render(hbs`{{bs-datetimepicker useCurrent=true showClear=true updateDate='handleDate'}}`);

andThen(function() {
assert.notEqual(date, undefined);
click($(".input-group-addon"));
});

andThen(function() {
click($("a[data-action='clear']"));
});

andThen(function() {
assert.equal(date, undefined);
});
});

0 comments on commit 8aa19c8

Please sign in to comment.