Skip to content

Commit

Permalink
Bug 962328 - [SMS] The keyboard does not automatically appear when co…
Browse files Browse the repository at this point in the history
…mposing a new SMS r=schung
  • Loading branch information
borjasalguero committed Feb 25, 2014
1 parent e1fb306 commit 8f777b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/sms/js/message_manager.js
Expand Up @@ -253,6 +253,7 @@ var MessageManager = {
if (ThreadUI.draft) {
ThreadUI.draft.isEdited = false;
}
ThreadUI.recipients.focus();
}.bind(this));
break;
case '#thread-list':
Expand Down
15 changes: 14 additions & 1 deletion apps/sms/test/unit/message_manager_test.js
Expand Up @@ -256,6 +256,7 @@ suite('message_manager.js >', function() {

setup(function() {
this.sinon.spy(ThreadUI, 'cleanFields');
this.sinon.spy(ThreadUI.recipients, 'focus');
ThreadUI.draft = null;
MessageManager.launchComposer();
});
Expand All @@ -273,8 +274,8 @@ suite('message_manager.js >', function() {
done();
});
});
suite('message drafts', function() {

suite('message drafts', function() {
setup(function() {
ThreadUI.draft = new Draft({
threadId: 1234,
Expand Down Expand Up @@ -686,16 +687,28 @@ suite('message_manager.js >', function() {
this.activity = MessageManager.activity = { test: true };
MessageManager.handleActivity();
ThreadUI.inThread = true; // to test this is reset correctly
this.sinon.spy(ThreadUI.recipients, 'focus');
window.location.hash = '#new';
MessageManager.onHashChange();
});

teardown(function() {
MessageManager.activity = null;
});

test('called handleActivity with activity', function() {
assert.ok(MessageManager.handleActivity.calledOnce);
});

test('focus after show "composer"', function(done) {
this.sinon.stub(MessageManager, 'launchComposer', function(cb) {
cb && cb();
assert.ok(ThreadUI.recipients.focus.called);
done();
});
MessageManager.onHashChange();
});

suite('> Switch to #thread=100', function() {
var closeSpy;
setup(function() {
Expand Down
3 changes: 2 additions & 1 deletion apps/sms/test/unit/mock_thread_ui.js
Expand Up @@ -9,7 +9,8 @@ var MockThreadUI = {
CONVERTED_MESSAGE_DURATION: 3000,
IMAGE_RESIZE_DURATION: 3000,
recipients: {
add: function() {}
add: function() {},
focus: function() {}
},
recipientsList: document.createElement('div'),

Expand Down

0 comments on commit 8f777b9

Please sign in to comment.