~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/js/tests/test_utils.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
YUI({ useBrowserConsole: true }).add('maas.utils.tests', function(Y) {
6
6
 
7
 
Y.log('loading mass.utils.tests');
 
7
Y.log('loading maas.utils.tests');
8
8
var namespace = Y.namespace('maas.utils.tests');
9
9
 
10
10
var module = Y.maas.utils;
127
127
        return widget;
128
128
    },
129
129
 
 
130
    test_widget_goes_away_quietly_if_not_wanted: function() {
 
131
        // If the srcNode isn't present on the page, the widget understands
 
132
        // that it's not wanted.  Rather than break, it simply refrains from
 
133
        // rendering.
 
134
        var widget = new module.TitleEditWidget({srcNode: '#no-widget-here'});
 
135
        widget.render();
 
136
        Y.Assert.areEqual(null, widget.get('input'));
 
137
    },
 
138
 
130
139
    test_getInput_returns_input: function() {
131
140
        var widget = this.createWidget();
132
141
        input = widget.get('srcNode').one('input');
256
265
        var input = widget.get('srcNode').one('input');
257
266
        input.simulate('blur');
258
267
        Y.Assert.isFalse(widget._editing);
259
 
    },
260
 
 
261
 
    test_input_enter_pressed_stops_editing: function() {
262
 
        var widget = this.createWidget();
263
 
        widget._editing = true;
264
 
        this.silentIO(module);
265
 
        var input = widget.get('srcNode').one('input');
266
 
        // Simulate 'Enter' being pressed.
267
 
        input.simulate("keypress", { keyCode: 13 });
268
 
        Y.Assert.isFalse(widget._editing);
269
268
    }
270
269
 
271
270
}));