aboutsummaryrefslogtreecommitdiffstats
path: root/library/jquery.AreYouSure/spec
diff options
context:
space:
mode:
authorChristian Vogeley <christian.vogeley@hotmail.de>2015-01-11 16:22:59 +0100
committerChristian Vogeley <christian.vogeley@hotmail.de>2015-01-11 16:22:59 +0100
commitf0c7612bcd49d32e408e67ac1829ee891c677f7e (patch)
treed4cff4aa2d728524b631776ffffee71f42056421 /library/jquery.AreYouSure/spec
parent43f143a211c75138d09ceb89acc48ea7d5c31ca9 (diff)
parent10102ac2ac4d5b02012a9794e23656717ab05556 (diff)
downloadvolse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.gz
volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.bz2
volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: doc/html/classRedmatrix_1_1Import_1_1Import-members.html doc/html/classRedmatrix_1_1Import_1_1Import.js
Diffstat (limited to 'library/jquery.AreYouSure/spec')
-rw-r--r--library/jquery.AreYouSure/spec/javascripts/fixtures/input-text.html4
-rw-r--r--library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js28
2 files changed, 32 insertions, 0 deletions
diff --git a/library/jquery.AreYouSure/spec/javascripts/fixtures/input-text.html b/library/jquery.AreYouSure/spec/javascripts/fixtures/input-text.html
new file mode 100644
index 000000000..1b2850759
--- /dev/null
+++ b/library/jquery.AreYouSure/spec/javascripts/fixtures/input-text.html
@@ -0,0 +1,4 @@
+<form>
+ <input type="text" name="a">
+ <input type="submit">
+</form>
diff --git a/library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js b/library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js
new file mode 100644
index 000000000..5e02f7cb0
--- /dev/null
+++ b/library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js
@@ -0,0 +1,28 @@
+'use strict';
+
+// Karma adds 'base/' to the default path
+jasmine.getFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
+
+describe("A form's", function() {
+ var $form = undefined;
+
+ describe('text input', function() {
+ var $textInput = undefined;
+
+ beforeEach(function() {
+ loadFixtures('input-text.html');
+ $form = $('form');
+ $textInput = $('input[type=text]');
+ $form.areYouSure();
+ });
+
+ it('should cause dirtyness after its value changes', function(done) {
+ expect($form.hasClass('dirty')).toBe(false);
+ $textInput.val('new').change();
+ setTimeout(function() {
+ expect($form.hasClass('dirty')).toBe(true);
+ done();
+ }, 0);
+ });
+ });
+});