How to use the faker.phone function in faker

To help you get started, we’ve selected a few faker 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 davellanedam / vue-skeleton-mvp / tests / e2e / specs / 07.profile.js View on Github external
it('Edits profile', () => {
    cy.login('admin@admin.com')
    cy.setLocaleToEN()
    cy.visit('/profile')

    const name = `${faker.name.firstName()} ${faker.name.lastName()}`
    const phone = faker.phone.phoneNumber()
    const country = faker.random.word()
    const urlTwitter = faker.internet.url()
    const urlGitHub = faker.internet.url()
    // name
    cy.get('input[name=name]')
      .clear()
      .type(name)
    // phone
    cy.get('input[name=phone]')
      .clear()
      .type(phone)
    // city
    cy.get('i.mdi-close')
      .should('have.class', 'mdi-close')
      .click()
    cy.get('i.mdi-menu-down')
github jurkian / react-bank / api / util / dummy-data.js View on Github external
const Message = require('@models/message');
const Transfer = require('@models/transfer');
const Stat = require('@models/stat');

// Create a user

// For each user
// Create 1-2 accounts, 1-3 cards, add 1-5 messages, add 1-10 transfers with random data

const defaultUserData = {
   email: faker.internet.email(),
   password: 'admin123',
   firstName: faker.name.firstName(),
   lastName: faker.name.lastName(),
   dateOfBirth: faker.date.between('1960-01-01', '2000-12-31'),
   phone: faker.phone.phoneNumberFormat(1),
   picture: faker.internet.avatar(),
   streetAddr: faker.address.streetAddress(),
   postcode: faker.address.zipCode(),
   city: faker.address.city()
};

const createUser = () => {
   const user = new User({ ...defaultUserData });

   return user.save();
};

const createControlledUser = () => {
   const user = new User({
      ...defaultUserData,
      email: 'email@example.com'
github serg-io / backbone-dynamodb / example-data.js View on Github external
type: 'work',
				line1: faker.address.streetAddress(),
				city: faker.address.city(),
				state: faker.address.stateAbbr(),
				zip: faker.address.zipCode()
			});

			if ( faker.random.boolean() ) {
				contact.addresses[ 1 ].line2 = faker.address.secondaryAddress();
			}
		}

		if ( faker.random.boolean() ) {
			contact.phones.push({
				type: 'work',
				number: faker.phone.phoneNumberFormat()
			});
		}

		if ( faker.random.boolean() ) {
			contact.emails.push({
				type: 'work',
				address: faker.internet.email()
			});
		}

		if ( faker.random.boolean() ) {
			contact.note = {
				lastUpdatedAt: faker.date.past(),
				note: faker.lorem.sentences()
			};
		} else if ( faker.random.boolean() ) {
github bullhorn / novo-elements / src / app / pages / components / autocomplete / demos / entity / entity.ts View on Github external
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import * as faker from 'faker';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/startWith';

export class FakeCandidate {
  public _subtype: string = 'Candidate';

  public firstName: string = faker.name.firstName();
  public lastName: string = faker.name.firstName();
  public name: string;
  public email: string;
  public phone: string = faker.phone.phoneNumber();
  public status: string = faker.company.bsBuzz();
  public companyName: string = faker.company.companyName();
  public address: { city: string; state: string } = {
    city: faker.address.city(),
    state: faker.address.stateAbbr(),
  };

  constructor() {
    this.name = faker.name.findName(this.firstName, this.lastName);
    this.email = faker.internet.email(this.firstName, this.lastName);
  }
}

@Component({
  selector: 'demo-autocomplete-entity',
  templateUrl: './entity.html',
github lestoni / faker-cli / index.js View on Github external
function getPhone(options){
  return faker.phone[options.type] &&
        faker.phone[options.type]();
}
github dogenzaka / ng-manager / example / data.js View on Github external
var user = function(i) {
  return {
    userId: 'user_' + i,
    firstName: faker.name.firstName(),
    lastName: faker.name.lastName(),
    email: faker.internet.email(),
    phone: faker.phone.phoneNumber(),
    vod: {
      dimentions: {
        width: 100,
        height: 100
      },
      duration: 3600000000
    },
    country: [{ key: 30, text: 'Japan' }, { key: 19, text: 'Spain' }],
    comment: "ng-manager\nExtensible management console running on angular and material design.\n\nThis project is under development.",
    userIcon: '55/14/55149073c31b4f9ab651a1b02fcdf9bd/55149073c31b4f9ab651a1b02fcdf9bd%401421660751423-400k-00001',
    createdAt: faker.date.past(),
    boolean: true
  };
};
github lestoni / faker-cli / index.js View on Github external
function getPhone(options){
  return faker.phone[options.type] &&
        faker.phone[options.type]();
}
github moovel / teamchatviz / server / data / lib / sync / index.js View on Github external
        getPhone: () => faker.phone.phoneNumber(),
        getImage24: () => {
github sandstorm / typescript-react-app-kickstart-guide / code / src / Domain / mockData.ts View on Github external
(_, index) => ({
        country: faker.address.country(),
        id: faker.random.uuid(),
        name: faker.company.companyName(),
        phone: faker.phone.phoneNumber(),
      })
    );