[MERGE] forward port branch saas-12.1 up to d785adba6c

This commit is contained in:
Christophe Simonis
2019-05-17 16:32:26 +02:00
60 changed files with 482 additions and 214 deletions
@@ -2661,6 +2661,25 @@ QUnit.module('basic_fields', {
form.destroy();
});
QUnit.test('date field should remove the date if the date is not valid', function (assert) {
assert.expect(1);
var form = createView({
View: FormView,
model: 'partner',
data: this.data,
arch: '<form string="Partners"><field name="date"/></form>',
res_id: 4,
});
// switch to edit mode
form.$buttons.find('.o_form_button_edit').click();
// set an invalid date
var $input = form.$('.o_field_widget[name=date] input');
$input.val('mmmh').trigger('change');
assert.strictEqual($input.text(), "", "The date field should be empty");
form.destroy();
});
QUnit.test('date field value should not set on first click', function (assert) {
assert.expect(2);