File tree 3 files changed +8
-8
lines changed
-ember-caluma/mirage/factories
testing/addon-mirage-support/factories
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";
2
2
import { Factory } from "miragejs" ;
3
3
4
4
export default Factory . extend ( {
5
- firstName : ( ) => faker . name . firstName ( ) ,
6
- lastName : ( ) => faker . name . lastName ( ) ,
5
+ firstName : ( ) => faker . person . firstName ( ) ,
6
+ lastName : ( ) => faker . person . lastName ( ) ,
7
7
} ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default Factory.extend({
21
21
22
22
if ( answer . value === undefined ) {
23
23
answer . update ( {
24
- value : faker . datatype . number ( {
24
+ value : faker . number . int ( {
25
25
min : answer . question . minValue ,
26
26
max : answer . question . maxValue ,
27
27
} ) ,
@@ -32,7 +32,7 @@ export default Factory.extend({
32
32
33
33
if ( answer . value === undefined ) {
34
34
answer . update ( {
35
- value : faker . datatype . number ( {
35
+ value : faker . number . int ( {
36
36
min : answer . question . minValue ,
37
37
max : answer . question . maxValue ,
38
38
precision : 0.1 ,
Original file line number Diff line number Diff line change @@ -19,24 +19,24 @@ export default Factory.extend({
19
19
if ( [ "TEXT" , "TEXTAREA" ] . includes ( question . type ) ) {
20
20
if ( question . maxLength === undefined ) {
21
21
question . update ( {
22
- maxLength : faker . datatype . number ( { min : 1 , max : 255 } ) ,
22
+ maxLength : faker . number . int ( { min : 1 , max : 255 } ) ,
23
23
} ) ;
24
24
}
25
25
if ( question . minLength === undefined ) {
26
26
question . update ( {
27
- minLength : faker . datatype . number ( { min : 1 , max : 10 } ) ,
27
+ minLength : faker . number . int ( { min : 1 , max : 10 } ) ,
28
28
} ) ;
29
29
}
30
30
} else if ( [ "INTEGER" , "FLOAT" ] . includes ( question . type ) ) {
31
31
if ( question . minValue === undefined ) {
32
32
question . update ( {
33
- minValue : faker . datatype . number ( { min : 1 , max : 100 } ) ,
33
+ minValue : faker . number . int ( { min : 1 , max : 100 } ) ,
34
34
} ) ;
35
35
}
36
36
37
37
if ( question . maxValue === undefined ) {
38
38
question . update ( {
39
- maxValue : faker . datatype . number ( {
39
+ maxValue : faker . number . int ( {
40
40
min : question . minValue + 1 ,
41
41
max : 1000 ,
42
42
} ) ,
You can’t perform that action at this time.
0 commit comments