How to use the rosie.Factory.buildList function in rosie

To help you get started, we’ve selected a few rosie 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 zooniverse / front-end-monorepo / packages / lib-classifier / src / store / WorkflowStepStore.spec.js View on Github external
hiddenSummaryWorkflow = WorkflowFactory.build({
        configuration: {
          hide_classification_summaries: true
        },
        steps: [
          ['S1', { taskKeys: ['T1'] }],
          ['S2', { taskKeys: ['T2'] }]
        ],
        tasks: {
          T1: SingleChoiceTaskFactory.build(),
          T2: MultipleChoiceTaskFactory.build()
        }
      })

      subjects = Factory.buildList('subject', 10)
      subject = subjects[0]
    })
github zooniverse / front-end-monorepo / packages / lib-classifier / src / store / SubjectStore.spec.js View on Github external
describe('Model > SubjectStore', function () {
  const longListSubjects = Factory.buildList('subject', 10)
  const shortListSubjects = Factory.buildList('subject', 2)

  function mockSubjectStore (subjects) {
    const project = ProjectFactory.build()
    const workflow = WorkflowFactory.build({ id: project.configuration.default_workflow })
    const client = stubPanoptesJs({ subjects, workflows: workflow })
    const store = RootStore.create({
      classifications: {},
      dataVisAnnotating: {},
      drawing: {},
      feedback: {},
      fieldGuide: {},
      subjectViewer: {},
      tutorials: {},
      workflowSteps: {},
      userProjectPreferences: {}
github zooniverse / front-end-monorepo / packages / lib-classifier / src / store / ClassificationStore.spec.js View on Github external
import taskRegistry from '@plugins/tasks'

const { AnnotationModel: SingleChoiceAnnotation } = taskRegistry.get('single')

const feedbackRulesStub = {
  T0: [{
    id: 'testRule',
    answer: '0',
    strategy: 'singleAnswerQuestion',
    successEnabled: true,
    successMessage: 'Yay!',
    failureEnabled: true,
    failureMessage: 'No!'
  }]
}
const subjectsStub = Factory.buildList('subject', 10)
const singleChoiceTaskStub = SingleChoiceTaskFactory.build()
const singleChoiceAnnotationStub = SingleChoiceAnnotationFactory.build()
const workflowStub = WorkflowFactory.build({ tasks: { T0: singleChoiceTaskStub } })
const projectStub = ProjectFactory.build({}, { activeWorkflowId: workflowStub.id })

describe('Model > ClassificationStore', function () {
  function setupStores (stores) {
    const clientStub = stubPanoptesJs({ classifications: [], subjects: subjectsStub })
    const store = RootStore.create(stores, {
      client: clientStub,
      authClient: { checkBearerToken: () => Promise.resolve(), checkCurrent: () => Promise.resolve() }
    })
    store.projects.setResource(projectStub)
    store.projects.setActive(projectStub.id)
    store.workflows.setResource(workflowStub)
    store.workflows.setActive(workflowStub.id)
github zooniverse / front-end-monorepo / packages / lib-classifier / src / store / SubjectStore.spec.js View on Github external
describe('Model > SubjectStore', function () {
  const longListSubjects = Factory.buildList('subject', 10)
  const shortListSubjects = Factory.buildList('subject', 2)

  function mockSubjectStore (subjects) {
    const project = ProjectFactory.build()
    const workflow = WorkflowFactory.build({ id: project.configuration.default_workflow })
    const client = stubPanoptesJs({ subjects, workflows: workflow })
    const store = RootStore.create({
      classifications: {},
      dataVisAnnotating: {},
      drawing: {},
      feedback: {},
      fieldGuide: {},
      subjectViewer: {},
      tutorials: {},
      workflowSteps: {},
      userProjectPreferences: {}
    }, {

rosie

factory for building JavaScript objects, mostly useful for setting up test data. Inspired by factory_girl

MIT
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis