[MERGE] forward port branch saas-12.2 up to 995aa1685e

This commit is contained in:
Christophe Simonis
2019-06-03 15:49:31 +02:00
209 changed files with 2398 additions and 1059 deletions
@@ -2549,6 +2549,25 @@ QUnit.module('basic_fields', {
form.destroy();
});
QUnit.test('date field should remove the date if the date is not valid', async function (assert) {
assert.expect(1);
var form = await createView({
View: FormView,
model: 'partner',
data: this.data,
arch: '<form string="Partners"><field name="date"/></form>',
res_id: 4,
});
// switch to edit mode
await testUtils.form.clickEdit(form);
// 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', async function (assert) {
assert.expect(2);