From 88cc66d2b4c5f0f11896a34954c6efda89e4e792 Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Tue, 20 Jun 2023 16:15:04 +0200 Subject: [PATCH] chore(faker): fix deprecated methods --- packages/-ember-caluma/mirage/factories/user.js | 4 ++-- packages/testing/addon-mirage-support/factories/answer.js | 4 ++-- .../testing/addon-mirage-support/factories/question.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/-ember-caluma/mirage/factories/user.js b/packages/-ember-caluma/mirage/factories/user.js index d9a2b86e4..84d2a6bf7 100644 --- a/packages/-ember-caluma/mirage/factories/user.js +++ b/packages/-ember-caluma/mirage/factories/user.js @@ -2,6 +2,6 @@ import { faker } from "@faker-js/faker"; import { Factory } from "miragejs"; export default Factory.extend({ - firstName: () => faker.name.firstName(), - lastName: () => faker.name.lastName(), + firstName: () => faker.person.firstName(), + lastName: () => faker.person.lastName(), }); diff --git a/packages/testing/addon-mirage-support/factories/answer.js b/packages/testing/addon-mirage-support/factories/answer.js index 95dc0a5c3..20a8ea169 100644 --- a/packages/testing/addon-mirage-support/factories/answer.js +++ b/packages/testing/addon-mirage-support/factories/answer.js @@ -21,7 +21,7 @@ export default Factory.extend({ if (answer.value === undefined) { answer.update({ - value: faker.datatype.number({ + value: faker.number.int({ min: answer.question.minValue, max: answer.question.maxValue, }), @@ -32,7 +32,7 @@ export default Factory.extend({ if (answer.value === undefined) { answer.update({ - value: faker.datatype.number({ + value: faker.number.int({ min: answer.question.minValue, max: answer.question.maxValue, precision: 0.1, diff --git a/packages/testing/addon-mirage-support/factories/question.js b/packages/testing/addon-mirage-support/factories/question.js index 638c18b10..cd624a012 100644 --- a/packages/testing/addon-mirage-support/factories/question.js +++ b/packages/testing/addon-mirage-support/factories/question.js @@ -19,24 +19,24 @@ export default Factory.extend({ if (["TEXT", "TEXTAREA"].includes(question.type)) { if (question.maxLength === undefined) { question.update({ - maxLength: faker.datatype.number({ min: 1, max: 255 }), + maxLength: faker.number.int({ min: 1, max: 255 }), }); } if (question.minLength === undefined) { question.update({ - minLength: faker.datatype.number({ min: 1, max: 10 }), + minLength: faker.number.int({ min: 1, max: 10 }), }); } } else if (["INTEGER", "FLOAT"].includes(question.type)) { if (question.minValue === undefined) { question.update({ - minValue: faker.datatype.number({ min: 1, max: 100 }), + minValue: faker.number.int({ min: 1, max: 100 }), }); } if (question.maxValue === undefined) { question.update({ - maxValue: faker.datatype.number({ + maxValue: faker.number.int({ min: question.minValue + 1, max: 1000, }),