Fix JavaScript Unit tests

This commit is contained in:
Dmitriy Simushev 2012-12-28 16:42:51 +00:00
parent 47ccc46359
commit 72e58f0959
2 changed files with 9 additions and 30 deletions

View File

@ -10,20 +10,20 @@
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<!-- Setup fixture -->
<script type="text/javascript">
Mibew = {};
</script>
<!-- Start of the mibew_api.js tests -->
<script type="text/javascript" src="/webim/js/164/json2.js"></script>
<script type="text/javascript" src="/webim/js/164/mibewapi.js"></script>
<script type="text/javascript" src="/webim/js/libs/json2.js"></script>
<script type="text/javascript" src="/webim/js/compiled/mibewapi.js"></script>
<script type="text/javascript" src="test_cases/mibewapi_tests.js"></script>
<!-- End of the mibew_api.js tests -->
<!-- Start of the PluginManager class tests -->
<script type="text/javascript" src="/webim/js/164/pluginmanager.js"></script>
<script type="text/javascript" src="test_cases/pluginmanager_tests.js"></script>
<!-- End of the mibew_api.js class tests -->
<!-- Start of Handlebars' helpers tests -->
<script type="text/javascript" src="/webim/js/164/handlebars.js"></script>
<script type="text/javascript" src="/webim/js/164/handlebars_helpers.js"></script>
<script type="text/javascript" src="/webim/js/libs/handlebars.js"></script>
<script type="text/javascript" src="/webim/js/compiled/default/handlebars_helpers.js"></script>
<script type="text/javascript" src="test_cases/handlebars_helpers_tests.js"></script>
<!-- Start of Handlebars' helpers tests -->
</body>

View File

@ -1,21 +0,0 @@
// Testing PluginManager class
module('PluginManager');
test('getPlugin', function() {
var pluginManager = new PluginManager();
// Try to load not stored plugin
equal(
pluginManager.getPlugin('WrongPlugin'),
false,
'Test loading not stored plugin'
)
// Try save and load test plugin
var testPlugin = {'testField': 'testValue'}
pluginManager.addPlugin('TestPlugin', testPlugin);
deepEqual(
pluginManager.getPlugin('TestPlugin'),
testPlugin,
'Test loading stored plugin'
);
});