How to use the ember-cli-mirage.faker.internet 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 code-corps / code-corps-ember / mirage / factories / user.js View on Github external
import { Factory, faker } from 'ember-cli-mirage';

export default Factory.extend({
  admin: false,
  biography: faker.lorem.paragraph,
  email: faker.internet.email,
  photoLargeUrl: faker.image.avatar,
  photoThumbUrl: faker.image.avatar,
  twitter: faker.internet.domainWord,
  username: faker.internet.domainWord,
  website: faker.internet.url,
  base64PhotoData: null,

  // ensures creation of associated records if they were not otherwise specified
  afterCreate(user, server) {
    if (!user.sluggedRoute) {
      user.sluggedRoute = server.create('slugged-route', { slug: user.username, user });
      user.save();
    }
  }
});
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 TryGhost / Ghost-Admin / tests / helpers / oauth.js View on Github external
let generateSecret = function generateSecret() {
    return faker.internet.password(12, false, /[a-f0-9]/);
};
github TryGhost / Ghost-Admin / tests / helpers / oauth.js View on Github external
let generateCode = function generateCode() {
    return faker.internet.password(32, false, /[a-zA-Z0-9]/);
};
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 CenterForOpenScience / ember-osf-web / mirage / views / developer-app.ts View on Github external
export function createDeveloperApp(this: HandlerContext, schema: Schema) {
    const attrs = {
        ...this.normalizedRequestAttrs('developer-app'),
        clientId: faker.internet.ip(),
        clientSecret: faker.random.uuid(),
    };
    return schema.developerApps.create(attrs);
}
github CenterForOpenScience / ember-osf-web / mirage / factories / developer-app.ts View on Github external
import { Factory, faker } from 'ember-cli-mirage';

import DeveloperApp from 'ember-osf-web/models/developer-app';

export default Factory.extend({
    id(i: number) {
        return i.toString().padStart(5, '0');
    },

    name() {
        return faker.lorem.words(4);
    },

    description: faker.lorem.sentence,

    homeUrl: faker.internet.url,

    callbackUrl() {
        return `https://${faker.internet.domainName()}`;
    },

    clientId() {
        return faker.internet.ip();
    },
    clientSecret() {
        return faker.random.uuid();
    },
});

declare module 'ember-cli-mirage/types/registries/schema' {
    export default interface MirageSchemaRegistry {
        developerApps: DeveloperApp;
github exercism / gui / mirage / factories / track.js View on Github external
repository() {
    return faker.internet.url();
  },
  todo() {
github linkedin / WhereHows / wherehows-web / mirage / factories / retention.ts View on Github external
import { PurgePolicy } from 'wherehows-web/constants';
import { hdfsUrn, nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';

export default Factory.extend({
  datasetId: null,

  datasetUrn: faker.list.random(hdfsUrn, nonHdfsUrn),

  purgeType: faker.list.random(...Object.values(PurgePolicy)),

  purgeNote() {
    const { purgeType } = this;
    return purgeType === PurgePolicy.PurgeExempt ? faker.lorem.words(5) : '';
  },

  modifiedBy: faker.internet.userName(),

  modifiedTime: faker.date.past()
});
github CenterForOpenScience / ember-osf-web / mirage / factories / meeting.ts View on Github external
infoUrl() {
        return faker.internet.url();
    },
    active: true,