Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "libs/qunit"] | ||
path = libs/qunit | ||
url = git://github.com/jquery/qunit.git |
Submodule qunit
added at
dbd005
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>jQuery.ime Test Suite</title> | ||
|
||
<!-- External libs --> | ||
<script src="../libs/jquery.js"></script> | ||
|
||
<!-- Source of our libs --> | ||
<script src="../src/jquery.ime.js"></script> | ||
<script src="../src/jquery.ime.selector.js"></script> | ||
<script src="../src/jquery.ime.preferences.js"></script> | ||
<script src="../src/jquery.ime.inputmethods.js"></script> | ||
|
||
<!-- Test framework --> | ||
<link rel="stylesheet" href="../libs/qunit/qunit/qunit.css"> | ||
<script src="../libs/qunit/qunit/qunit.js"></script> | ||
|
||
<!-- Test config --> | ||
<script> | ||
QUnit.config.requireExpects = true; | ||
</script> | ||
|
||
<!-- Test Suite --> | ||
<script src="jquery.ime.test.js"></script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
( function ( $ ) { | ||
'use strict'; | ||
|
||
var $textarea, $input; | ||
|
||
QUnit.module( 'jquery.ime - $.fn.ime Tests', { | ||
setup: function () { | ||
$textarea = $( '<textarea>' ); | ||
$input = $( '<input>' ); | ||
}, | ||
teardown: function () { | ||
} | ||
} ); | ||
|
||
QUnit.test( 'Initialization', 3, function ( assert ) { | ||
assert.strictEqual( typeof $textarea.ime, 'function', 'ime function exists' ); | ||
assert.strictEqual( typeof $textarea.data('ime'), 'undefined', 'ime not initialized before calling ime()' ); | ||
|
||
$textarea.ime(); | ||
assert.strictEqual( typeof $textarea.data('ime'), 'object', 'ime initialized after calling ime()' ); | ||
} ); | ||
}( jQuery ) ); |