From b0d17a96a5c6ceccd9534d983baba089024c0c9a Mon Sep 17 00:00:00 2001 From: Thijs Louisse Date: Thu, 8 Sep 2016 10:45:44 +0200 Subject: [PATCH] changed error attr from 'name' to 'validator' added resolutions documentation error message markup added resolution demo page name adjusted formatting, trying to make diffing easier in github minimize diff --- bower.json | 3 + demo/old-vs-new/index.html | 2 +- iron-validatable-behavior.html | 439 ++++++++++++++-------------- test/iron-validatable-behavior.html | 20 +- 4 files changed, 234 insertions(+), 230 deletions(-) diff --git a/bower.json b/bower.json index 204466a..2aa7b77 100644 --- a/bower.json +++ b/bower.json @@ -35,6 +35,9 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "resolutions": { + "paper-input": "feature/multipleValidators", + "iron-validator-behavior": "feature/multipleValidators", + "iron-input": "feature/multipleValidators", "iron-validatable-behavior": "feature/multipleValidators" } } diff --git a/demo/old-vs-new/index.html b/demo/old-vs-new/index.html index 416efcf..4485b3a 100755 --- a/demo/old-vs-new/index.html +++ b/demo/old-vs-new/index.html @@ -4,7 +4,7 @@ - tgc-forms Demo + Multiple validators - Before and after diff --git a/iron-validatable-behavior.html b/iron-validatable-behavior.html index 9b5b111..1c9dda9 100644 --- a/iron-validatable-behavior.html +++ b/iron-validatable-behavior.html @@ -13,224 +13,225 @@ diff --git a/test/iron-validatable-behavior.html b/test/iron-validatable-behavior.html index ab808fa..e9d1b46 100644 --- a/test/iron-validatable-behavior.html +++ b/test/iron-validatable-behavior.html @@ -185,10 +185,10 @@ var validatable = fixture('multipleValidators')[2]; validatable.validate('cat'); assert.equal(validatable.errors.length, 2); - assert.equal(validatable.errors[0].name, 'no-cats'); + assert.equal(validatable.errors[0].validator, 'no-cats'); assert.equal(validatable.errors[0].message, 'No cat(s) allowed'); assert.equal(validatable.errors[0].priority, 0); - assert.equal(validatable.errors[1].name, 'no-catfishes'); + assert.equal(validatable.errors[1].validator, 'no-catfishes'); assert.equal(validatable.errors[1].message, 'No cat(fish(es)) allowed'); assert.equal(validatable.errors[1].priority, 1); }); @@ -215,13 +215,13 @@ validatable.value = ''; validatable.validate(); - assert.equal(validatable.errors[0].name, 'required'); + assert.equal(validatable.errors[0].validator, 'required'); assert.equal(validatable.errors[0].priority, 0); - assert.equal(validatable.errors[1].name, 'cats-only'); + assert.equal(validatable.errors[1].validator, 'cats-only'); assert.equal(validatable.errors[1].priority, 1); - assert.equal(validatable.errors[2].name, 'dogs-only'); + assert.equal(validatable.errors[2].validator, 'dogs-only'); assert.equal(validatable.errors[2].priority, 2); }); @@ -230,9 +230,9 @@ validatable.value = '2'; validatable.validate(); - assert.equal(validatable.errors[0].name, 'min'); + assert.equal(validatable.errors[0].validator, 'min'); assert.equal(validatable.errors[0].priority, 0); - assert.equal(validatable.errors[1].name, 'step'); + assert.equal(validatable.errors[1].validator, 'step'); assert.equal(validatable.errors[1].priority, 1); }); @@ -240,7 +240,7 @@ var validatable = fixture('override-native-messages').querySelector('[min]'); validatable.validate(); - assert.equal(validatable.errors[0].name, 'min'); + assert.equal(validatable.errors[0].validator, 'min'); assert.equal(validatable.errors[0].message, 'customMin'); }); @@ -264,7 +264,7 @@ validatable.validate(); - assert.equal(validatable.errors[0].name, validator, 'Validator [' + validator + '] is not triggered'); + assert.equal(validatable.errors[0].validator, validator, 'Validator [' + validator + '] is not triggered'); assert.equal(validatable.errors[0].message, msg, 'Validation message for validator [' + validator + '] is not set properly'); }); }); @@ -280,7 +280,7 @@ validatable.validate(); - assert.equal(validatable.errors[0].name, validator, 'Validator [' + validator + '] is not triggered'); + assert.equal(validatable.errors[0].validator, validator, 'Validator [' + validator + '] is not triggered'); assert.equal(validatable.errors[0].message, msg, 'Validation message for validator [' + validator + '] is not set properly'); }); });