~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js

  • Committer: Jeff Craig
  • Date: 2010-07-09 06:25:06 UTC
  • mto: (11446.2.1 foxxtrot-308198)
  • mto: This revision was merged to the branch mainline in revision 11451.
  • Revision ID: foxxtrot@foxxtrot.net-20100709062506-sniib2bqxpfqsm6j
Add unit tests for ensuring LP collections contain LP entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
457
457
        var collection = test.result.args[0];
458
458
        jum.assertTrue(collection instanceof LP.client.Collection);
459
459
        jum.assertEquals(4, collection.total_size);
 
460
    },
 
461
    'wait_action',
 
462
    function (test) {
 
463
        jum.assertEquals('success', test.result.callback);
 
464
        var entries = test.result.args[0].entries,
 
465
            length = test.result.args[0].total_size,
 
466
            index;
 
467
        for (index = 0 ; index < length ; index += 1) {
 
468
            jum.assertTrue(entries[index] instanceof LP.client.Entry);
 
469
        }
 
470
    },
 
471
    'wait_action',
 
472
    function (test) {
 
473
        jum.assertEquals('success', test.result.callback);
 
474
        var entry = test.result.args[0].entries[0];
 
475
        jum.assertEquals('test', entry.display_name);
 
476
        entry.set('display_name', "Set Display Name");
 
477
        entry.lp_save({on: test.create_yui_sync_on()});
 
478
    },
 
479
    'wait_action',
 
480
    function (test) {
 
481
        jum.assertEquals('success', test.result.callback);
 
482
        client.get('people', { on: test.create_yui_sync_on()});
 
483
    },
 
484
    'wait_action',
 
485
    function (test) {
 
486
        jum.assertEquals('success', test.result.callback);
 
487
        var entry = test.result.args[0].entries[0];
 
488
        jum.assertEquals('Set Display Name', entry.display_name);
460
489
    }
461
490
    ]);
462
491