From f6d1d3221ae5fbb0a576e539d271825658f2652b Mon Sep 17 00:00:00 2001 From: Francisco Borja Salguero Castellano Date: Fri, 12 Jul 2013 05:38:19 -0700 Subject: [PATCH] Merge pull request #10941 from julienw/890460-fixedheader-followup Bug 890460 - [SMS] After deleting all the messages in particular thread,...(cherry picked from commit accb67f7beb3f00f8bcf23337e3ced0795cff4c9) --- apps/sms/js/thread_list_ui.js | 1 + apps/sms/test/unit/thread_list_ui_test.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/sms/js/thread_list_ui.js b/apps/sms/js/thread_list_ui.js index 3c6226c889fb..fa9e78d573a1 100644 --- a/apps/sms/js/thread_list_ui.js +++ b/apps/sms/js/thread_list_ui.js @@ -339,6 +339,7 @@ var ThreadListUI = { }); } else { ThreadListUI.setEmpty(true); + FixedHeader.refresh(); // Callback if exist if (renderCallback) { diff --git a/apps/sms/test/unit/thread_list_ui_test.js b/apps/sms/test/unit/thread_list_ui_test.js index 7c5e3c93b58a..ab4ca22e5cc0 100644 --- a/apps/sms/test/unit/thread_list_ui_test.js +++ b/apps/sms/test/unit/thread_list_ui_test.js @@ -514,4 +514,18 @@ suite('thread_list_ui', function() { }); }); }); + + suite('renderThreads', function() { + setup(function() { + this.sinon.spy(FixedHeader, 'refresh'); + this.sinon.spy(ThreadListUI, 'setEmpty'); + }); + + test('Rendering an empty screen', function() { + ThreadListUI.renderThreads([]); + assert.ok(FixedHeader.refresh.called); + assert.ok(ThreadListUI.setEmpty.called); + assert.isTrue(ThreadListUI.setEmpty.args[0][0]); + }); + }); });