diff options
author | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-09 21:30:03 +0300 |
---|---|---|
committer | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-09 21:30:03 +0300 |
commit | db4c1f665fb51c64ffb1917503cc6e5b2dd00be8 (patch) | |
tree | d733f4d8128dc5b49bac022ba080006e16586704 /spec/javascripts/groups | |
parent | 10836664487a771319e2d97dd7b9011dcd017f14 (diff) |
enable jasmine/prefer-jasmine-matcher
Diffstat (limited to 'spec/javascripts/groups')
5 files changed, 15 insertions, 15 deletions
diff --git a/spec/javascripts/groups/components/group_item_spec.js b/spec/javascripts/groups/components/group_item_spec.js index d0cac5efc40..49d4f7efd72 100644 --- a/spec/javascripts/groups/components/group_item_spec.js +++ b/spec/javascripts/groups/components/group_item_spec.js @@ -45,7 +45,7 @@ describe('GroupItemComponent', () => { expect(Object.keys(rowClass).length).toBe(classes.length); Object.keys(rowClass).forEach((className) => { - expect(classes.indexOf(className) > -1).toBeTruthy(); + expect(classes.indexOf(className)).toBeGreaterThan(-1); }); }); }); diff --git a/spec/javascripts/groups/components/groups_spec.js b/spec/javascripts/groups/components/groups_spec.js index 793c4909d89..5af86b55532 100644 --- a/spec/javascripts/groups/components/groups_spec.js +++ b/spec/javascripts/groups/components/groups_spec.js @@ -53,7 +53,7 @@ describe('GroupsComponent', () => { expect(vm.$el.querySelector('.groups-list-tree-container')).toBeDefined(); expect(vm.$el.querySelector('.group-list-tree')).toBeDefined(); expect(vm.$el.querySelector('.gl-pagination')).toBeDefined(); - expect(vm.$el.querySelectorAll('.has-no-search-results').length === 0).toBeTruthy(); + expect(vm.$el.querySelectorAll('.has-no-search-results').length).toBe(0); done(); }); }); diff --git a/spec/javascripts/groups/components/item_stats_spec.js b/spec/javascripts/groups/components/item_stats_spec.js index ee7ee18259e..e6a57495eb1 100644 --- a/spec/javascripts/groups/components/item_stats_spec.js +++ b/spec/javascripts/groups/components/item_stats_spec.js @@ -107,7 +107,7 @@ describe('ItemStatsComponent', () => { const visibilityIconEl = vm.$el.querySelector('.item-visibility'); expect(visibilityIconEl).not.toBe(null); expect(visibilityIconEl.dataset.originalTitle).toBe(vm.visibilityTooltip); - expect(visibilityIconEl.querySelectorAll('svg').length > 0).toBeTruthy(); + expect(visibilityIconEl.querySelectorAll('svg').length).toBeGreaterThan(0); vm.$destroy(); }); @@ -120,10 +120,10 @@ describe('ItemStatsComponent', () => { const vm = createComponent(item); const projectStarIconEl = vm.$el.querySelector('.project-stars'); - expect(projectStarIconEl).not.toBe(null); - expect(projectStarIconEl.querySelectorAll('svg').length > 0).toBeTruthy(); - expect(projectStarIconEl.querySelectorAll('.stat-value').length > 0).toBeTruthy(); - expect(vm.$el.querySelectorAll('.last-updated').length > 0).toBeTruthy(); + expect(projectStarIconEl).not.toBeNull(); + expect(projectStarIconEl.querySelectorAll('svg').length).toBeGreaterThan(0); + expect(projectStarIconEl.querySelectorAll('.stat-value').length).toBeGreaterThan(0); + expect(vm.$el.querySelectorAll('.last-updated').length).toBeGreaterThan(0); vm.$destroy(); }); diff --git a/spec/javascripts/groups/components/item_stats_value_spec.js b/spec/javascripts/groups/components/item_stats_value_spec.js index 5e35ae4d36c..2a995e8efe6 100644 --- a/spec/javascripts/groups/components/item_stats_value_spec.js +++ b/spec/javascripts/groups/components/item_stats_value_spec.js @@ -57,8 +57,8 @@ describe('ItemStatsValueComponent', () => { it('renders component element correctly', () => { expect(vm.$el.classList.contains('number-subgroups')).toBeTruthy(); - expect(vm.$el.querySelectorAll('svg').length > 0).toBeTruthy(); - expect(vm.$el.querySelectorAll('.stat-value').length > 0).toBeTruthy(); + expect(vm.$el.querySelectorAll('svg').length).toBeGreaterThan(0); + expect(vm.$el.querySelectorAll('.stat-value').length).toBeGreaterThan(0); }); it('renders element tooltip correctly', () => { diff --git a/spec/javascripts/groups/store/groups_store_spec.js b/spec/javascripts/groups/store/groups_store_spec.js index d74f38f476e..78caf8f80bf 100644 --- a/spec/javascripts/groups/store/groups_store_spec.js +++ b/spec/javascripts/groups/store/groups_store_spec.js @@ -29,7 +29,7 @@ describe('ProjectsStore', () => { store.setGroups(mockGroups); expect(store.state.groups.length).toBe(mockGroups.length); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); - expect(Object.keys(store.state.groups[0]).indexOf('fullName') > -1).toBeTruthy(); + expect(Object.keys(store.state.groups[0]).indexOf('fullName')).toBeGreaterThan(-1); }); }); @@ -41,8 +41,8 @@ describe('ProjectsStore', () => { store.setSearchedGroups(mockSearchedGroups); expect(store.state.groups.length).toBe(mockSearchedGroups.length); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); - expect(Object.keys(store.state.groups[0]).indexOf('fullName') > -1).toBeTruthy(); - expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName') > -1).toBeTruthy(); + expect(Object.keys(store.state.groups[0]).indexOf('fullName')).toBeGreaterThan(-1); + expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName')).toBeGreaterThan(-1); }); }); @@ -54,7 +54,7 @@ describe('ProjectsStore', () => { store.setGroupChildren(mockParentGroupItem, mockRawChildren); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); expect(mockParentGroupItem.children.length).toBe(1); - expect(Object.keys(mockParentGroupItem.children[0]).indexOf('fullName') > -1).toBeTruthy(); + expect(Object.keys(mockParentGroupItem.children[0]).indexOf('fullName')).toBeGreaterThan(-1); expect(mockParentGroupItem.isOpen).toBeTruthy(); expect(mockParentGroupItem.isChildrenLoading).toBeFalsy(); }); @@ -81,14 +81,14 @@ describe('ProjectsStore', () => { store = new GroupsStore(); updatedGroupItem = store.formatGroupItem(mockRawChildren[0]); - expect(Object.keys(updatedGroupItem).indexOf('fullName') > -1).toBeTruthy(); + expect(Object.keys(updatedGroupItem).indexOf('fullName')).toBeGreaterThan(-1); expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].children_count); expect(updatedGroupItem.isChildrenLoading).toBe(false); expect(updatedGroupItem.isBeingRemoved).toBe(false); store = new GroupsStore(true); updatedGroupItem = store.formatGroupItem(mockRawChildren[0]); - expect(Object.keys(updatedGroupItem).indexOf('fullName') > -1).toBeTruthy(); + expect(Object.keys(updatedGroupItem).indexOf('fullName')).toBeGreaterThan(-1); expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].subgroup_count); }); }); |