How to use the ember-cli-mirage.faker.name function in ember-cli-mirage

To help you get started, we’ve selected a few ember-cli-mirage 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 lifegadget / ui-list / tests / dummy / app / mirage / factories / appointment.js View on Github external
import Mirage, {faker} from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  firstName: faker.name.firstName,       // using faker
  lastName: faker.name.lastName,
  email: function(i) {                  // and functions
    return 'person' + i + '@email.com';
  },
  when: faker.date.future,
  quantity: faker.random.number,
  avatar: faker.image.avatar,
  topic: faker.lorem.words,
  status: faker.list.random('downloaded','verifying','verified','scheduling','scheduled','preparing','executing','executed')
});
github code-corps / code-corps-ember / mirage / factories / project.js View on Github external
import { Factory, faker } from 'ember-cli-mirage';
import Ember from 'ember';

const { String } = Ember;

export default Factory.extend({
  closedTasksCount: 0,
  description: faker.lorem.sentence,
  iconLargeUrl: faker.image.imageUrl,
  iconThumbUrl: faker.image.imageUrl,
  openTasksCount: 0,
  title: faker.name.title,
  website: faker.url,

  slug() {
    if (this.title) {
      return String.underscore(this.title.toLowerCase());
    }
  },

  // ensures associations exist if they haven't been provided
  afterCreate(project, server) {
    if (!project.organization) {
      project.organization = server.create('organization');
      project.save();
    }
  }
});
github offirgolan / ember-light-table / tests / dummy / mirage / factories / user.js View on Github external
/*
  This is an example factory definition.

  Create more files in this directory to define additional factories.
*/
import Mirage, { faker } from 'ember-cli-mirage';

faker.locale = 'en_US';

const MATERIAL_UI_COLORS = ['#F44336', '#E91E63', '#9C27B0', '#009688', '#2196F3', '#4CAF50', '#FFC107', '#FF5722', '#607D8B'];

export default Mirage.Factory.extend({
  firstName: faker.name.firstName,
  lastName: faker.name.firstName,
  company: faker.company.companyName,
  address: faker.address.streetAddress,
  country: faker.address.country,
  state: faker.address.state,
  email: faker.internet.email,
  username: faker.internet.userName,
  avatar: faker.internet.avatar,
  bio: faker.lorem.paragraph,
  color: () => faker.random.arrayElement(MATERIAL_UI_COLORS)
});
github CenterForOpenScience / ember-osf-web / mirage / factories / meeting-submission.ts View on Github external
authorName() {
        return faker.name.findName();
    },
    downloadCount() {
github CenterForOpenScience / ember-osf-web / mirage / factories / contributor.ts View on Github external
unregisteredContributor() {
        return faker.random.number(5) ? undefined : faker.name.firstName();
    },
    index(i: number) {
github CenterForOpenScience / ember-osf-web / mirage / factories / user.ts View on Github external
middleNames() {
        return `${faker.name.firstName()} ${faker.name.firstName()}`;
    },
    familyName() {
github linkedin / WhereHows / wherehows-web / mirage / factories / owner.ts View on Github external
name() {
    return faker.name.firstName() + ' ' + faker.name.lastName();
  },
  userSetting() {
github CenterForOpenScience / ember-osf-web / mirage / factories / institutional-user.ts View on Github external
userFullName() {
        return `${faker.name.firstName()} ${faker.name.lastName()}`;
    },
    department() {