1
/* Copyright (c) 2011, Canonical Ltd. All rights reserved. */
3
base: '../../../../canonical/launchpad/icing/yui/',
8
// Don't forget to add the module under test to the use() clause.
10
}).use('event', 'lp.client', 'node', 'test', 'widget-stack',
11
'console', function(Y) {
14
var Assert = Y.Assert,
15
ArrayAssert = Y.ArrayAssert;
16
var mynamespace = Y.lp.mynamespace;
17
var suite = new Y.Test.Suite("mynamespace Tests");
19
suite.add(new Y.Test.Case({
20
// Test the setup method.
25
test_config_undefined: true,
30
this.tbody = Y.get('#milestone-rows');
33
tearDown: function() {
35
mynamespace._milestone_row_uri_template = null;
36
mynamespace._tbody = null;
39
test_good_config: function() {
40
// Verify the config data is stored.
42
milestone_row_uri_template: '/uri',
43
milestone_rows_id: '#milestone-rows'
45
mynamespace.setup(config);
47
config.milestone_row_uri_template,
48
mynamespace._milestone_row_uri_template);
49
Y.Assert.areSame(this.tbody, mynamespace._tbody);
52
test_config_undefined: function() {
53
// Verify an error is thrown if there is no config.
59
var handle_complete = function(data) {
60
window.status = '::::' + JSON.stringify(data);
62
Y.Test.Runner.on('complete', handle_complete);
63
Y.Test.Runner.add(suite);
65
var yconsole = new Y.Console({
68
yconsole.render('#log');
70
Y.on('domready', function() {