File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
-ember-caluma/mirage/factories
testing/addon-mirage-support/factories Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ import { faker } from "@faker-js/faker";
22import { Factory } from "miragejs" ;
33
44export default Factory . extend ( {
5- firstName : ( ) => faker . name . firstName ( ) ,
6- lastName : ( ) => faker . name . lastName ( ) ,
5+ firstName : ( ) => faker . person . firstName ( ) ,
6+ lastName : ( ) => faker . person . lastName ( ) ,
77} ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default Factory.extend({
2121
2222 if ( answer . value === undefined ) {
2323 answer . update ( {
24- value : faker . datatype . number ( {
24+ value : faker . number . int ( {
2525 min : answer . question . minValue ,
2626 max : answer . question . maxValue ,
2727 } ) ,
@@ -32,7 +32,7 @@ export default Factory.extend({
3232
3333 if ( answer . value === undefined ) {
3434 answer . update ( {
35- value : faker . datatype . number ( {
35+ value : faker . number . int ( {
3636 min : answer . question . minValue ,
3737 max : answer . question . maxValue ,
3838 precision : 0.1 ,
Original file line number Diff line number Diff line change @@ -19,24 +19,24 @@ export default Factory.extend({
1919 if ( [ "TEXT" , "TEXTAREA" ] . includes ( question . type ) ) {
2020 if ( question . maxLength === undefined ) {
2121 question . update ( {
22- maxLength : faker . datatype . number ( { min : 1 , max : 255 } ) ,
22+ maxLength : faker . number . int ( { min : 1 , max : 255 } ) ,
2323 } ) ;
2424 }
2525 if ( question . minLength === undefined ) {
2626 question . update ( {
27- minLength : faker . datatype . number ( { min : 1 , max : 10 } ) ,
27+ minLength : faker . number . int ( { min : 1 , max : 10 } ) ,
2828 } ) ;
2929 }
3030 } else if ( [ "INTEGER" , "FLOAT" ] . includes ( question . type ) ) {
3131 if ( question . minValue === undefined ) {
3232 question . update ( {
33- minValue : faker . datatype . number ( { min : 1 , max : 100 } ) ,
33+ minValue : faker . number . int ( { min : 1 , max : 100 } ) ,
3434 } ) ;
3535 }
3636
3737 if ( question . maxValue === undefined ) {
3838 question . update ( {
39- maxValue : faker . datatype . number ( {
39+ maxValue : faker . number . int ( {
4040 min : question . minValue + 1 ,
4141 max : 1000 ,
4242 } ) ,
You can’t perform that action at this time.
0 commit comments