aboutsummaryrefslogtreecommitdiffstats
path: root/library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-01-02 12:10:27 +1100
committerRedMatrix <info@friendica.com>2015-01-02 12:10:27 +1100
commitdb811ca975e6880ff6540a61c216e7e2432ea75e (patch)
treecd643f63d36936d7b9d475547cf6acb58df5aaff /library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js
parentb54235234fdba83bc4505672e65ad94fbdbccb62 (diff)
parent9557908875af76d167797a36e980798349fc63b5 (diff)
downloadvolse-hubzilla-db811ca975e6880ff6540a61c216e7e2432ea75e.tar.gz
volse-hubzilla-db811ca975e6880ff6540a61c216e7e2432ea75e.tar.bz2
volse-hubzilla-db811ca975e6880ff6540a61c216e7e2432ea75e.zip
Merge pull request #804 from pafcu/areyousure
Warn about unsaved settings using jquery.areyousure
Diffstat (limited to 'library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js')
-rw-r--r--library/jquery.AreYouSure/spec/javascripts/jquery.are-you-sure_spec.js28
1 files changed, 28 insertions, 0 deletions
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);
+ });
+ });
+});