diff --git a/ui/tests/index.html b/ui/tests/index.html index d6fe4ced205..5b8baebb18f 100644 --- a/ui/tests/index.html +++ b/ui/tests/index.html @@ -72,5 +72,8 @@ + + + diff --git a/ui/tests/test.core.js b/ui/tests/test.core.js new file mode 100644 index 00000000000..4829b36a10c --- /dev/null +++ b/ui/tests/test.core.js @@ -0,0 +1,31 @@ +(function($) { + test('Main widget', function() { + var cloudStack = { + sections: { + home: {}, + sectionA: {}, + sectionB: {}, + sectionC: {} + }, + + home: 'home' + }; + + var $cloudStack = $('
'); + + ok($cloudStack.cloudStack(cloudStack), 'Basic widget initialized'); + + // Main containers/wrappers + equal($cloudStack.find('[cloudStack-container]').size(), 1, 'Main sub-container present'); + equal($cloudStack.find('#main-area').size(), 1, 'Main area present'); + + // Header + var $header = $cloudStack.find('#header'); + equal($header.size(), 1, 'Header present'); + + // Navigation + var $navigation = $cloudStack.find('#navigation'); + equal($navigation.size(), 1, 'Navigation present'); + equal($navigation.find('li').size(), 4, 'Navigation has correct # of nav items'); + }); +}(jQuery));