15
14
var Assert = Y.Assert,
16
15
ArrayAssert = Y.ArrayAssert;
18
var suite = new Y.Test.Suite("YOUR TEST SUITE NAME");
16
var mynamespace = Y.lp.mynamespace;
17
var suite = new Y.Test.Suite("mynamespace Tests");
20
19
suite.add(new Y.Test.Case({
20
// Test the setup method.
22
name: 'A TEST CASE NAME',
25
test_config_undefined: true,
24
29
setUp: function() {
25
// Monkeypatch LP to avoid network traffic and to make
26
// some things work as expected.
27
Y.lp.client.Launchpad.prototype.named_post =
28
function(url, func, config) {
34
self_link: "http://bugs.example.com/bugs/1234"
30
this.tbody = Y.get('#milestone-rows');
38
33
tearDown: function() {
42
* The choice edit should be displayed inline.
44
test_something: 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.
50
59
var handle_complete = function(data) {
51
60
window.status = '::::' + JSON.stringify(data);