diff --git a/test/unit/specs/components/chat_view.spec.js b/test/unit/specs/components/chat_view.spec.js index c308e4fbc..d03809e38 100644 --- a/test/unit/specs/components/chat_view.spec.js +++ b/test/unit/specs/components/chat_view.spec.js @@ -66,10 +66,10 @@ describe('ChatView methods', () => { it("Doesn't add duplicates", () => { component.vm.addMessages({ messages: [message1] }) component.vm.addMessages({ messages: [message1] }) - expect(component.vm.messages.length).to.eql(1) + expect(component.vm.messages).to.have.length(1) component.vm.addMessages({ messages: [message2] }) - expect(component.vm.messages.length).to.eql(2) + expect(component.vm.messages).to.have.length(2) }) it('Updates minId and lastMessage and newMessageCount', async () => { @@ -127,11 +127,11 @@ describe('ChatView methods', () => { }) } component.vm.cullOlder() - expect(component.vm.messages.length).to.eql(50) + expect(component.vm.messages).to.have.length(50) expect(component.vm.messages[0].id).to.eql('a0.051') expect(component.vm.minId).to.eql('a0.051') expect(component.vm.messages[49].id).to.eql('a0.100') - expect(Object.keys(component.vm.messagesIndex).length).to.eql(50) + expect(Object.keys(component.vm.messagesIndex)).to.have.length(50) }) }) }) diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index cd43496a9..04bd07ffe 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -278,7 +278,7 @@ describe('Statuses module', () => { timeline: 'public', }) - expect(state.timelines.public.visibleStatuses.length).to.eql(1) + expect(state.timelines.public.visibleStatuses).to.have.length(1) expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(1) expect(state.timelines.public.maxId).to.eq(favorite.id) @@ -289,7 +289,7 @@ describe('Statuses module', () => { timeline: 'public', }) - expect(state.timelines.public.visibleStatuses.length).to.eql(1) + expect(state.timelines.public.visibleStatuses).to.have.length(1) expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(1) expect(state.timelines.public.maxId).to.eq(favorite.id) @@ -314,7 +314,7 @@ describe('Statuses module', () => { user, }) - expect(state.timelines.public.visibleStatuses.length).to.eql(1) + expect(state.timelines.public.visibleStatuses).to.have.length(1) expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(1) expect(state.timelines.public.visibleStatuses[0].favorited).to.eql(true) }) @@ -406,7 +406,7 @@ describe('Statuses module', () => { emoji: '😂', currentUser: { id: 'me' }, }) - expect(state.allStatusesObject['1'].emoji_reactions.length).to.eql(0) + expect(state.allStatusesObject['1'].emoji_reactions).to.have.length(0) }) }) @@ -428,7 +428,7 @@ describe('Statuses module', () => { state.timelines.public.minId = '5' mutations.showNewStatuses(state, { timeline: 'public' }) - expect(state.timelines.public.visibleStatuses.length).to.eql(2) + expect(state.timelines.public.visibleStatuses).to.have.length(2) expect(state.timelines.public.minVisibleId).to.equal('10') expect(state.timelines.public.minId).to.equal('10') }) diff --git a/test/unit/specs/stores/sync_config.spec.js b/test/unit/specs/stores/sync_config.spec.js index a045aa18a..d2e6d42d3 100644 --- a/test/unit/specs/stores/sync_config.spec.js +++ b/test/unit/specs/stores/sync_config.spec.js @@ -125,7 +125,7 @@ describe('The SyncConfig store', () => { }, }) - expect(store.prefsStorage._journal.length).to.eql(500) + expect(store.prefsStorage._journal).to.have.length(500) }) it('should reset local timestamp to remote if contents are the same', async () => { @@ -173,7 +173,7 @@ describe('The SyncConfig store', () => { } store.setPreference({ path: 'simple.palette', value: '1' }) expect(store.prefsStorage.simple.palette).to.eql('1') - expect(store.prefsStorage._journal.length).to.eql(1) + expect(store.prefsStorage._journal).to.have.length(1) expect(store.prefsStorage._journal[0]).to.eql({ path: 'simple.palette', operation: 'set', @@ -199,7 +199,7 @@ describe('The SyncConfig store', () => { store.updateCache({ username: 'test' }) expect(store.prefsStorage.simple.palette).to.eql(2) expect(store.prefsStorage.collections.palette).to.eql([]) - expect(store.prefsStorage._journal.length).to.eql(2) + expect(store.prefsStorage._journal).to.have.length(2) expect(store.prefsStorage._journal[0]).to.eql({ path: 'simple.palette', operation: 'set', @@ -229,7 +229,7 @@ describe('The SyncConfig store', () => { store.updateCache({ username: 'test' }) expect(store.prefsStorage.simple.palette).to.eql(1) expect(store.prefsStorage.collections.palette).to.eql([2]) - expect(store.prefsStorage._journal.length).to.eql(2) + expect(store.prefsStorage._journal).to.have.length(2) }) // TODO We need a proper test for object-based stores @@ -245,7 +245,7 @@ describe('The SyncConfig store', () => { expect(store.prefsStorage.simple.fontInput).to.not.have.property( 'family', ) - expect(store.prefsStorage._journal.length).to.eql(1) + expect(store.prefsStorage._journal).to.have.length(1) }) it('should not allow unsetting depth <= 2', () => { diff --git a/test/unit/specs/stores/user_highlight.spec.js b/test/unit/specs/stores/user_highlight.spec.js index f80143b6e..e97f8f382 100644 --- a/test/unit/specs/stores/user_highlight.spec.js +++ b/test/unit/specs/stores/user_highlight.spec.js @@ -55,7 +55,7 @@ describe('The UserHighlight store', () => { user: 'highlight@testing', type: 'test', }) - expect(store.highlight._journal.length).to.eql(1) + expect(store.highlight._journal).to.have.length(1) expect(store.highlight._journal[0]).to.eql({ user: 'highlight@testing', operation: 'set', @@ -74,7 +74,7 @@ describe('The UserHighlight store', () => { user: 'highlight@testing.xyz', type: 'test', }) - expect(store.highlight._journal.length).to.eql(1) + expect(store.highlight._journal).to.have.length(1) expect(store.highlight._journal[0]).to.eql({ user: 'highlight@testing.xyz', operation: 'set', @@ -98,7 +98,7 @@ describe('The UserHighlight store', () => { user: 'a@test.xyz', type: 'foo', }) - expect(store.highlight._journal.length).to.eql(1) + expect(store.highlight._journal).to.have.length(1) }) }) })