Commit 4f2a7a2f authored by Shubham Pandey's avatar Shubham Pandey Committed by Natalia Tepluhina

[UPDATE] Replace underscore.first with lodash.head

parent b9940c46
---
title: Replaced underscore with lodash for spec/javascripts/vue_shared/components
merge_request: 25018
author: Shubham Pandey
type: other
import Vue from 'vue'; import Vue from 'vue';
import _ from 'underscore'; import { head } from 'lodash';
import { GlSearchBoxByType, GlInfiniteScroll } from '@gitlab/ui'; import { GlSearchBoxByType, GlInfiniteScroll } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
...@@ -99,9 +99,9 @@ describe('ProjectSelector component', () => { ...@@ -99,9 +99,9 @@ describe('ProjectSelector component', () => {
it(`triggers a "projectClicked" event when a project is clicked`, () => { it(`triggers a "projectClicked" event when a project is clicked`, () => {
spyOn(vm, '$emit'); spyOn(vm, '$emit');
wrapper.find(ProjectListItem).vm.$emit('click', _.first(searchResults)); wrapper.find(ProjectListItem).vm.$emit('click', head(searchResults));
expect(vm.$emit).toHaveBeenCalledWith('projectClicked', _.first(searchResults)); expect(vm.$emit).toHaveBeenCalledWith('projectClicked', head(searchResults));
}); });
it(`shows a "no results" message if showNoResultsMessage === true`, () => { it(`shows a "no results" message if showNoResultsMessage === true`, () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment