aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-28 10:01:22 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-09-02 19:24:48 -0400
commit7f82fffbe97c4eac05ff7f484930cb068b6b152b (patch)
treef88459635fb3c0a77e43a4f99d35f68433a38d03 /tests/visual
parent6c4367b45e2666f52b7efe5d7d1aa6986f95ca7e (diff)
downloadjquery-ui-7f82fffbe97c4eac05ff7f484930cb068b6b152b.tar.gz
jquery-ui-7f82fffbe97c4eac05ff7f484930cb068b6b152b.zip
Effects Tests: Add shake visual test
Closes gh-1328
Diffstat (limited to 'tests/visual')
-rw-r--r--tests/visual/effects/shake.html99
-rw-r--r--tests/visual/index.html1
2 files changed, 100 insertions, 0 deletions
diff --git a/tests/visual/effects/shake.html b/tests/visual/effects/shake.html
new file mode 100644
index 000000000..595412b2b
--- /dev/null
+++ b/tests/visual/effects/shake.html
@@ -0,0 +1,99 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Effects Test Suite</title>
+ <link rel="stylesheet" href="effects.css">
+ <script src="../../../external/jquery/jquery.js"></script>
+ <script src="../../../ui/effect.js"></script>
+ <script src="../../../ui/effect-scale.js"></script>
+ <script src="../../../ui/effect-shake.js"></script>
+ <script>
+ $(function() {
+ $( "#btn" ).click(function() {
+ $( ".shake" ).effect( "shake", {
+ duration: +$( "#duration" ).val(),
+ mode: "toggle"
+ });
+ });
+ });
+ </script>
+ <style>
+ #inputbox {
+ background: green;
+ }
+ #selectbox {
+ background: red;
+ }
+ #divbox {
+ background: yellow;
+ }
+ #inputbox_abs {
+ background: orange;
+ position: absolute;
+ top: 500px;
+ left: 300px;
+ }
+ #divbox_abs {
+ background: purple;
+ position: absolute;
+ top: 500px;
+ left: 500px;
+ }
+ div.shake {
+ background: lightblue;
+ }
+
+ .margin {
+ margin: 3px;
+ }
+ .border {
+ border: 1px solid black;
+ }
+ .padding {
+ padding: 10px;
+ }
+ </style>
+</head>
+<body>
+
+<p>WHAT: A set of elements with various box-model properties, using the shake effect to toggle.</p>
+<p>EXPECTED: When clicking "Toggle", all elements should not change dimension nor position, aside from the expected shake animation, which should take the number of milliseconds specified to complete. At the end of the animation, all elements should hide.</p>
+<p>EXPECTED: Clicking "Toggle" a second time reverses the animation, first showing all elements at their original dimensions, and restoring them to their original state.</p>
+
+<button id="btn">Toggle</button>
+<input id="duration" value="1000">
+<div id="divbox">
+ <div class="shake margin">test</div>
+ <div class="shake border">test</div>
+ <div class="shake padding margin">test</div>
+</div>
+<div id="inputbox" class="margin">
+ <div class="shake margin">test</div>
+ <div class="shake margin border">test</div>
+ <div class="shake padding">test</div>
+ <input type="text" class="shake">
+</div>
+<div id="selectbox">
+ <div class="shake">test</div>
+ <div class="shake">test</div>
+ <div class="shake">test</div>
+ <select class="shake">
+ <option value="a">a</option>
+ <option value="abcdef">abcdef</option>
+ </select>
+</div>
+<div id="inputbox_abs" class="margin">
+ <div class="shake margin">test</div>
+ <div class="shake margin border">test</div>
+ <div class="shake padding">test</div>
+ <input type="text" class="shake">
+</div>
+<div id="divbox_abs" class="margin">
+ <div class="shake margin">test</div>
+ <div class="shake margin border">test</div>
+ <div class="shake padding">test</div>
+</div>
+
+</body>
+</html>
diff --git a/tests/visual/index.html b/tests/visual/index.html
index 736ba3117..940157219 100644
--- a/tests/visual/index.html
+++ b/tests/visual/index.html
@@ -49,6 +49,7 @@
<ul>
<li><a href="effects/all.html">All</a></li>
<li><a href="effects/scale.html">Scale</a></li>
+ <li><a href="effects/shake.html">Shake</a></li>
</ul>
<h2>Menu</h2>