diff --git a/test/runtime/samples/onupdate/_config.js b/test/runtime/samples/onupdate/_config.js new file mode 100644 index 0000000000..1603c5a74a --- /dev/null +++ b/test/runtime/samples/onupdate/_config.js @@ -0,0 +1,21 @@ +export default { + solo: true, + 'skip-ssr': true, + + data: { + value: 'hello!' + }, + + html: ` +
hello!
+hello!
+ `, + + test(assert, component, target) { + component.set({ value: 'goodbye!' }); + assert.htmlEqual(target.innerHTML, ` +goodbye!
+goodbye!
+ `); + } +}; diff --git a/test/runtime/samples/onupdate/main.html b/test/runtime/samples/onupdate/main.html new file mode 100644 index 0000000000..ea65e9f3d2 --- /dev/null +++ b/test/runtime/samples/onupdate/main.html @@ -0,0 +1,12 @@ +{{value}}
+ + + \ No newline at end of file diff --git a/test/validator/samples/onstate-arrow-no-this/errors.json b/test/validator/samples/onstate-arrow-no-this/errors.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/test/validator/samples/onstate-arrow-no-this/errors.json @@ -0,0 +1 @@ +[] diff --git a/test/validator/samples/onstate-arrow-no-this/input.html b/test/validator/samples/onstate-arrow-no-this/input.html new file mode 100644 index 0000000000..dcd651f66a --- /dev/null +++ b/test/validator/samples/onstate-arrow-no-this/input.html @@ -0,0 +1,5 @@ + diff --git a/test/validator/samples/onstate-arrow-this/errors.json b/test/validator/samples/onstate-arrow-this/errors.json new file mode 100644 index 0000000000..cfcba87f4e --- /dev/null +++ b/test/validator/samples/onstate-arrow-this/errors.json @@ -0,0 +1,12 @@ +[{ + "message": "'onstate' should be a function expression, not an arrow function expression", + "pos": 29, + "loc": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } +}] diff --git a/test/validator/samples/onstate-arrow-this/input.html b/test/validator/samples/onstate-arrow-this/input.html new file mode 100644 index 0000000000..f0921ea81d --- /dev/null +++ b/test/validator/samples/onstate-arrow-this/input.html @@ -0,0 +1,7 @@ + diff --git a/test/validator/samples/onupdate-arrow-no-this/errors.json b/test/validator/samples/onupdate-arrow-no-this/errors.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/test/validator/samples/onupdate-arrow-no-this/errors.json @@ -0,0 +1 @@ +[] diff --git a/test/validator/samples/onupdate-arrow-no-this/input.html b/test/validator/samples/onupdate-arrow-no-this/input.html new file mode 100644 index 0000000000..72c35b0df9 --- /dev/null +++ b/test/validator/samples/onupdate-arrow-no-this/input.html @@ -0,0 +1,5 @@ + diff --git a/test/validator/samples/onupdate-arrow-this/errors.json b/test/validator/samples/onupdate-arrow-this/errors.json new file mode 100644 index 0000000000..e4c1a3a441 --- /dev/null +++ b/test/validator/samples/onupdate-arrow-this/errors.json @@ -0,0 +1,12 @@ +[{ + "message": "'onupdate' should be a function expression, not an arrow function expression", + "pos": 29, + "loc": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } +}] diff --git a/test/validator/samples/onupdate-arrow-this/input.html b/test/validator/samples/onupdate-arrow-this/input.html new file mode 100644 index 0000000000..3f4dcd897d --- /dev/null +++ b/test/validator/samples/onupdate-arrow-this/input.html @@ -0,0 +1,7 @@ +