fix(form): On device disconnect,"Rather not say" is selected by default (#5289) r=vladikoff

Fixes #5277
This commit is contained in:
apoorvasingh17 2017-08-15 21:08:04 +05:30 коммит произвёл Vlad Filippov
Родитель 05f9ffba3b
Коммит 274103a336
2 изменённых файлов: 3 добавлений и 19 удалений

Просмотреть файл

@ -27,7 +27,7 @@
{{#t}}Duplicate device{{/t}}
</label>
<label>
<input type="radio" name="disconnect-reasons" value="no"/>
<input type="radio" name="disconnect-reasons" value="no" checked="checked"/>
{{#t}}Rather not say{{/t}}
</label>
</p>

Просмотреть файл

@ -105,9 +105,11 @@ define(function (require, exports, module) {
describe('render', () => {
it('renders initial view', () => {
return view.render().then(() => {
sinon.spy(view, 'enableForm');
assert.ok($(view.el).find('.intro').length, 'intro text');
assert.ok($(view.el).find('.disconnect-reasons').length, 'radio');
assert.notOk($(view.el).find('.reason-help').length, 'help');
assert.ok($(view.el).find('input[name=disconnect-reasons][value=no]').prop('checked'), 'Rather not Say');
});
});
@ -132,24 +134,6 @@ define(function (require, exports, module) {
});
});
describe('selectOption event', () => {
it('select disables form properly', () => {
sinon.spy(view, 'disableForm');
sinon.spy(view, 'enableForm');
return view.render().then(() => {
assert.ok(view.disableForm.calledOnce);
assert.notOk(view.enableForm.calledOnce);
assert.ok($(view.el).find('.warning.disabled').length, 'has disabled class');
// choose an option
$(view.el).find('input[name=disconnect-reasons][value=no]').prop('checked', true).change();
assert.notOk($(view.el).find('.warning.disabled').length, 'no disabled button');
assert.ok(view.disableForm.calledOnce);
assert.ok(view.enableForm.calledOnce);
});
});
});
describe('_returnToClientListAfterDisconnect event', () => {
it('does not navigate if not disconnected', () => {