summaryrefslogtreecommitdiffstats
path: root/doc/backends/deckjs/deck.js/test/spec.scale.js
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-16 17:40:01 +0200
committerimarom <imarom@cisco.com>2016-11-16 17:40:01 +0200
commit11c216470c30e4c200e46e1b51d721a549f440d6 (patch)
tree03ad20c67decf7da4d52e5679c2fd22dd8f5eaa6 /doc/backends/deckjs/deck.js/test/spec.scale.js
parente46e3f598e52112b9db21d6faabde7a5c87341cb (diff)
parentefba1bd2c32391c443a9dbaf0fffa6468bb681c6 (diff)
Merge branch 'master' to rx_features phase 0.5
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'doc/backends/deckjs/deck.js/test/spec.scale.js')
-rw-r--r--doc/backends/deckjs/deck.js/test/spec.scale.js57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/backends/deckjs/deck.js/test/spec.scale.js b/doc/backends/deckjs/deck.js/test/spec.scale.js
new file mode 100644
index 00000000..02be2d87
--- /dev/null
+++ b/doc/backends/deckjs/deck.js/test/spec.scale.js
@@ -0,0 +1,57 @@
+describe('Deck JS Status Indicator', function() {
+ beforeEach(function() {
+ loadFixtures('standard.html');
+ if (Modernizr.history) {
+ history.replaceState({}, "", "#")
+ }
+ else {
+ window.location.hash = '#';
+ }
+ $.deck('.slide');
+ });
+
+ it('should start with scaling enabled', function() {
+ expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
+ });
+
+ describe('disableScale()', function() {
+ it('should remove the scale class from the container', function() {
+ $.deck('disableScale');
+ expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
+ });
+ });
+
+ describe('enableScale()', function() {
+ it('should add the scale class to the container', function() {
+ $.deck('disableScale');
+ $.deck('enableScale');
+ expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
+ });
+ });
+
+ describe('toggleScale()', function() {
+ it('should toggle between adding and removing the scale class', function() {
+ $.deck('toggleScale');
+ expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
+ $.deck('toggleScale');
+ expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
+ });
+ });
+
+ describe('key bindings', function() {
+ var e;
+ var $d = $(document);
+
+ beforeEach(function() {
+ e = jQuery.Event('keydown.deckscale');
+ });
+
+ it('should toggle scaling if the specified key is pressed', function() {
+ e.which = 83; // s
+ $d.trigger(e);
+ expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
+ $d.trigger(e);
+ expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
+ });
+ });
+}); \ No newline at end of file