import { mount } from '@vue/test-utils' import Vuetify from 'vuetify' import Address from '~/components/Ui/Search/Address' import response from '~/tests/unit/component/Ui/Search/fixtures/response' global.fetch = jest.fn(() => Promise.resolve({ json: () => Promise.resolve( response ) }) ) let wrapper let vuetify beforeEach(() => { vuetify = new Vuetify() fetch.mockClear() }) describe('components/ui/search/address', () => { it('an input of 1+ cars shall display results', async () => { wrapper = mount(Address, { vuetify }) const addressSearchBar = wrapper.find('.v-autocomplete') // addressSearchBar.element.search = 'paris' // await addressSearchBar.trigger('click') addressSearchBar.find('input[type="text"]').setValue('paris') const resultsList = wrapper.find('v-autocomplete__content') expect(resultsList.exists()).toBeTruthy() expect(resultsList.find('div:contains("Paris")').exists()).toBeTruthy() }) it('position shall be set when a result is clicked', async () => {}) it('position shall be cleared when input is cleared', async () => {}) it('first result shall be selected when enter key is pressed', async () => {}) it('user position shall be set when localize icon is clicked', async () => {}) it('error message shall be displayed if the browser does not support localization', async () => {}) })