How to use the ember-cli-mirage.faker.lorem 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 CenterForOpenScience / ember-osf-web / mirage / factories / collection.ts View on Github external
import { Factory, faker } from 'ember-cli-mirage';

import Collection from 'ember-osf-web/models/collection';

import { guid, guidAfterCreate } from './utils';

export default Factory.extend({
    id: guid('collection'),
    afterCreate: guidAfterCreate,

    title: faker.lorem.sentence(),
    dateCreated: faker.date.past(2),
    dateModified: faker.date.past(2),
    bookmarks: faker.random.boolean(),
});

declare module 'ember-cli-mirage/types/registries/schema' {
    export default interface MirageSchemaRegistry {
        collections: Collection;
    } // eslint-disable-line semi
}
github ember-admin / ember-cli-admin / tests / dummy / app / mirage / factories / user_category.js View on Github external
import Mirage, { faker } from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  name: faker.company.bsNoun(),
  zip_code: '123456',
  email: faker.internet.email(),
  is_created: true,
  expired_at: faker.date.past(),
  color: faker.internet.color(),
  description: faker.lorem.sentences(10),
  avatar_ids: function() {
    return [1, 2];
  },
});
github offirgolan / ember-time-machine / tests / dummy / mirage / factories / task.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';

export default Mirage.Factory.extend({
  title: faker.lorem.sentence,
  isCompleted: false
});
github CenterForOpenScience / ember-osf-web / mirage / factories / file.ts View on Github external
tags() {
        return faker.lorem.words(5).split(' ');
    },
    size() {
github CenterForOpenScience / ember-osf-web / mirage / factories / comment.ts View on Github external
content() {
        return faker.lorem.sentences(faker.random.number({ min: 1, max: 4 }));
    },
    dateCreated() {
github linkedin / WhereHows / wherehows-web / mirage / factories / health.ts View on Github external
validations() {
      const validations: Array = [];

      for (let i = 0; i < 3; i++) {
        const validation: IHealthScoreObject = {
          tier: tierOptions[i],
          score: 1 - (3 - i) * 0.25,
          description: faker.lorem.sentences(2),
          weight: faker.random.number({ min: 0, max: 100 }) / 100,
          validator: 'fake'
        };

        validations.push(validation);
      }
    }
  })
github hummingbird-me / hummingbird-client / mirage / factories / media.js View on Github external
  synopsis() { return faker.lorem.paragraphs(); },
  titles: {
github linkedin / WhereHows / wherehows-web / mirage / factories / dataset-view.ts View on Github external
import { Factory, faker } from 'ember-cli-mirage';
import { DatasetPlatform } from 'wherehows-web/constants';
import { hdfsUrn, nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';

export default Factory.extend({
  createdTime: faker.date.past(2),
  deprecated: true,
  deprecationNote: faker.lorem.words(5),
  description: faker.lorem.words(7),
  fabric: null,
  modifiedTime: faker.date.recent(),
  nativeName: 'abook.default-public-container',
  nativeType: null,
  platform: faker.list.random(...Object.values(DatasetPlatform)),
  properties: '{}',
  removed: faker.random.boolean(),
  tags: null,
  uri() {
    const { platform } = this;
    return platform === DatasetPlatform.HDFS
      ? hdfsUrn
      : nonHdfsUrn.replace(/li:dataPlatform:db/, `li:dataPlatform:${platform}`);
  }
});
github CenterForOpenScience / ember-osf-web / mirage / factories / collection-provider.ts View on Github external
import { Factory, faker } from 'ember-cli-mirage';

import { randomGravatar } from 'ember-osf-web/mirage/utils';
import CollectionProvider from 'ember-osf-web/models/collection-provider';

import { guid, guidAfterCreate } from './utils';

export default Factory.extend({
    id: guid('collection-provider'),
    afterCreate: guidAfterCreate,
    advisoryBoard: faker.lorem.paragraph,
    emailSupport: '',
    name: faker.lorem.word,
    domain: faker.internet.domainName,
    allowCommenting: false,
    assets: {
        square_color_no_transparent: randomGravatar(100),
    },
    facebookAppId: '',
    footerLinks: '',
    allowSubmissions: true,
    example: '',
    domainRedirectEnabled: false,
    description: faker.lorem.paragraph,
});