Skip to content

Commit

Permalink
add failing test for clearing date
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhertzler committed Feb 3, 2015
1 parent 35f1cf6 commit 9ffd203
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/date-picker-component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ test("it updates displayed value when bound date changes", function() {
equal(this.$().val(), "2000-01-01", "displays new date");
});

test("it updates displayed value to nothing when date is unset after having a previous value and `allowBlank: true`", function() {
expect(2);
component = this.subject({
allowBlank: true
});

// initial render
this.$();

component.set('date', moment("2000-01-01").format('X'));

equal(this.$().val(), "2000-01-01", "displays new date");

component.set('date', null);

equal(this.$().val(), "", "input is empty");
});

/**
* Test custom `format` with complex format and custom `valueFormat` with
Expand Down

0 comments on commit 9ffd203

Please sign in to comment.