~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/javascript/tests/test_requestbuild_overlay.js

Submit form in overlay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
 
123
123
    test_requestbuilds_success: function() {
124
124
        var mockio = new Y.lp.testing.mockio.MockIo(),
125
 
            request_builds_link = Y.one('#request-builds');
 
125
            request_builds_link = Y.one('#request-builds'),
 
126
            submit_button;
126
127
        module.connect_requestbuilds({io_provider: mockio});
127
128
        request_builds_link.simulate('click');
128
129
 
 
130
        // The form overlay requests the form from the server.
129
131
        Y.Assert.areSame(1, mockio.requests.length);
130
132
        mockio.success({
131
133
            responseText: requestform_markup,
134
136
        Y.Assert.areSame(2, mockio.requests.length);
135
137
        Y.Assert.areSame(
136
138
            "ws.op=getPendingBuildInfo", mockio.last_request.config.data);
 
139
        // This response is not really needed for the test.
137
140
        mockio.success({
138
141
            responseText: "[]",
139
142
            responseHeaders: {'Content-Type': 'application/json'}
140
143
        });
 
144
        // Submit the form.
 
145
        submit_button = Y.one("[name='field.actions.request']");
 
146
        submit_button.simulate('click');
 
147
        Y.Assert.areSame(3, mockio.requests.length);
 
148
        
141
149
    }
142
150
}));
143
151