diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/tests/mochitest/ajax/prototype/test/unit/element_mixins_test.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | dom/tests/mochitest/ajax/prototype/test/unit/element_mixins_test.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/element_mixins_test.js b/dom/tests/mochitest/ajax/prototype/test/unit/element_mixins_test.js new file mode 100644 index 0000000000..239179375c --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/element_mixins_test.js @@ -0,0 +1,32 @@ +new Test.Unit.Runner({ + testInput: function() { + this.assert($("input").present != null); + this.assert(typeof $("input").present == 'function'); + this.assert($("input").select != null); + this.assertRespondsTo('present', Form.Element); + this.assertRespondsTo('present', Form.Element.Methods); + this.assertRespondsTo('coffee', $('input')); + this.assertIdentical(Prototype.K, Form.Element.coffee); + this.assertIdentical(Prototype.K, Form.Element.Methods.coffee); + }, + + testForm: function() { + this.assert($("form").reset != null); + this.assert($("form").getInputs().length == 2); + }, + + testEvent: function() { + this.assert($("form").observe != null) + // Can't really test this one with TestUnit... + $('form').observe("submit", function(e) { + alert("yeah!"); + Event.stop(e); + }); + }, + + testCollections: function() { + this.assert($$("input").all(function(input) { + return (input.focus != null); + })); + } +});
\ No newline at end of file |