How to use the wix-ui-core/dist/src/components/address-input/GoogleMapsClientStub.GoogleMapsClientStub.setGeocode function in wix-ui-core

To help you get started, we’ve selected a few wix-ui-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / wix-ui-backoffice / src / components / AddressInput / AddressInput.spec.tsx View on Github external
import * as React from 'react';
import { createDriverFactory } from 'wix-ui-test-utils/driver-factory';
import { addressInputDriverFactory } from './AddressInput.driver';
import { AddressInput } from '.';
import { mount } from 'enzyme';
import { GoogleMapsClientStub } from 'wix-ui-core/dist/src/components/address-input/GoogleMapsClientStub';
import * as helper from 'wix-ui-core/dist/src/components/address-input/AddressInputTestHelper';
import * as waitForCond from 'wait-for-cond';
import { AddressInputProps } from './AddressInput';
import Search from 'wix-ui-icons-common/Search';

GoogleMapsClientStub.setAddresses([helper.ADDRESS_1, helper.ADDRESS_2]);
GoogleMapsClientStub.setGeocode(helper.GEOCODE_1);

const commonProps = {
  apiKey: '',
  Client: GoogleMapsClientStub,
  lang: 'ru',
  onSelect: () => null
};

describe('AddressInput', () => {
  const createDriver = createDriverFactory(addressInputDriverFactory);

  it('should always set the core prop forceContentElementVisibility to false', () => {
    const props = {
      ...commonProps,
      forceContentElementVisibility: true
    } as AddressInputProps;
github wix / wix-ui-backoffice / stories / AddressInput.story.tsx View on Github external
import * as React from 'react';
import { AddressInput } from '../src/components/AddressInput';
import { Option } from 'wix-ui-core/dist/src/components/dropdown-option';
import { GoogleMapsClientStub } from 'wix-ui-core/dist/src/components/address-input/GoogleMapsClientStub';
import * as helper from 'wix-ui-core/dist/src/components/address-input/AddressInputTestHelper';

GoogleMapsClientStub.setAddresses([helper.ADDRESS_1, helper.ADDRESS_2]);
GoogleMapsClientStub.setGeocode(helper.GEOCODE_1);

export default {
  category: 'Components',
  storyName: 'AddressInput',
  component: AddressInput,
  componentPath: '../src/components/AddressInput/AddressInput.tsx',

  componentProps: {
    'data-hook': 'storybook-address-input',
    fixedFooter: 'Fixed Footer',
    fixedHeader: 'Fixed Header',
    Client: GoogleMapsClientStub
  },

  exampleProps: {
    onSelect: (option: Option) => option.value,