From 133d541a4811ed1f63a260d28454c53e7ec027c5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 18 Aug 2020 13:45:32 +1000 Subject: [PATCH] fix tests --- js/models/messages.js | 2 +- test/app/fixtures/menu-mac-os-setup.json | 6 +----- test/app/fixtures/menu-mac-os.json | 2 +- .../fixtures/menu-windows-linux-setup.json | 6 +----- test/app/fixtures/menu-windows-linux.json | 2 +- test/models/messages_test.js | 10 ++++----- test/views/network_status_view_test.js | 21 ------------------- 7 files changed, 10 insertions(+), 39 deletions(-) diff --git a/js/models/messages.js b/js/models/messages.js index 53ad520b2..bd69ec79e 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -231,7 +231,7 @@ messages.push(i18n('kickedFromTheGroup', names[0])); } } - return messages.join(', '); + return messages.join(' '); } if (this.isEndSession()) { return i18n(this.getEndSessionTranslationKey()); diff --git a/test/app/fixtures/menu-mac-os-setup.json b/test/app/fixtures/menu-mac-os-setup.json index 861511f8a..ff584845c 100644 --- a/test/app/fixtures/menu-mac-os-setup.json +++ b/test/app/fixtures/menu-mac-os-setup.json @@ -3,7 +3,7 @@ "label": "Session", "submenu": [ { - "label": "About Session", + "label": "About", "click": null }, { @@ -39,10 +39,6 @@ { "label": "Set Up with Import", "click": null - }, - { - "label": "Set Up as New Device", - "click": null } ] }, diff --git a/test/app/fixtures/menu-mac-os.json b/test/app/fixtures/menu-mac-os.json index b2ea56aaf..60851f18d 100644 --- a/test/app/fixtures/menu-mac-os.json +++ b/test/app/fixtures/menu-mac-os.json @@ -3,7 +3,7 @@ "label": "Session", "submenu": [ { - "label": "About Session", + "label": "About", "click": null }, { diff --git a/test/app/fixtures/menu-windows-linux-setup.json b/test/app/fixtures/menu-windows-linux-setup.json index e72303d39..5c07b68d5 100644 --- a/test/app/fixtures/menu-windows-linux-setup.json +++ b/test/app/fixtures/menu-windows-linux-setup.json @@ -6,10 +6,6 @@ "label": "Set Up with Import", "click": null }, - { - "label": "Set Up as New Device", - "click": null - }, { "type": "separator" }, @@ -134,7 +130,7 @@ "type": "separator" }, { - "label": "About Session", + "label": "About", "click": null } ] diff --git a/test/app/fixtures/menu-windows-linux.json b/test/app/fixtures/menu-windows-linux.json index aa6a1171d..de337349e 100644 --- a/test/app/fixtures/menu-windows-linux.json +++ b/test/app/fixtures/menu-windows-linux.json @@ -123,7 +123,7 @@ "type": "separator" }, { - "label": "About Session", + "label": "About", "click": null } ] diff --git a/test/models/messages_test.js b/test/models/messages_test.js index 7b0f7ece0..fbe3e7de8 100644 --- a/test/models/messages_test.js +++ b/test/models/messages_test.js @@ -94,21 +94,21 @@ describe('MessageCollection', () => { message = messages.add({ group_update: { left: 'Alice' } }); assert.equal( message.getDescription(), - 'Alice left the group', + 'Alice has left the group.', 'Notes one person leaving the group.' ); message = messages.add({ group_update: { name: 'blerg' } }); assert.equal( message.getDescription(), - "Group name has been set to 'blerg'", + "Group name is now 'blerg'.", 'Returns a single notice if only group_updates.name changes.' ); message = messages.add({ group_update: { joined: ['Bob'] } }); assert.equal( message.getDescription(), - 'Bob joined the group', + 'Bob joined the group.', 'Returns a single notice if only group_updates.joined changes.' ); @@ -117,7 +117,7 @@ describe('MessageCollection', () => { }); assert.equal( message.getDescription(), - 'Bob, Alice, Eve joined the group', + 'Bob, Alice, Eve joined the group.', 'Notes when >1 person joins the group.' ); @@ -126,7 +126,7 @@ describe('MessageCollection', () => { }); assert.equal( message.getDescription(), - "Group name has been set to 'blerg', Bob joined the group", + "Group name is now 'blerg'. Bob joined the group.", 'Notes when there are multiple changes to group_updates properties.' ); diff --git a/test/views/network_status_view_test.js b/test/views/network_status_view_test.js index 85cb64c68..488ff7101 100644 --- a/test/views/network_status_view_test.js +++ b/test/views/network_status_view_test.js @@ -74,27 +74,6 @@ describe('NetworkStatusView', () => { assert.match(networkStatusView.$el.text(), /Offline/); }); }); - describe('network status when registration is not done', () => { - beforeEach(() => { - Whisper.Registration.remove(); - }); - it('should display an unlinked message', () => { - networkStatusView.update(); - assert.match(networkStatusView.$el.text(), /Relink/); - }); - it('should override socket status', () => { - _([ - WebSocket.CONNECTING, - WebSocket.OPEN, - WebSocket.CLOSING, - WebSocket.CLOSED, - ]).forEach(socketStatusVal => { - socketStatus = socketStatusVal; - networkStatusView.update(); - assert.match(networkStatusView.$el.text(), /Relink/); - }); - }); - }); describe('network status when registration is done', () => { beforeEach(() => { networkStatusView.navigatorOnLine = () => true;