Bug 38503: Deal with types that can be "null"
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
34f6663374
commit
3bc9bd8b62
|
|
@ -12,6 +12,7 @@ describe("Generate Random Patron", () => {
|
|||
values: { surname: "test_surname" },
|
||||
}).then(mockPatron => {
|
||||
expect(mockPatron.surname).to.equal("test_surname");
|
||||
expect(mockPatron.overdues_count).to.be.a("number");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ const objects = {
|
|||
},
|
||||
};
|
||||
const generateMockData = type => {
|
||||
if (Array.isArray(type)) {
|
||||
type = type.filter(t => t != '"null"')[0];
|
||||
}
|
||||
switch (type) {
|
||||
case "string":
|
||||
return faker.lorem.words(3);
|
||||
|
|
|
|||
Loading…
Reference in New Issue