add support for custom text fields

This commit is contained in:
Hayden 2022-10-15 21:41:27 -08:00
parent 57f9372e49
commit 434f1fa411
11 changed files with 384 additions and 38 deletions

View file

@ -2,11 +2,23 @@ import { faker } from "@faker-js/faker";
import { expect } from "vitest";
import { overrideParts } from "../../base/urls";
import { PublicApi } from "../../public";
import { LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
import { ItemField, LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
import * as config from "../../../../test/config";
import { UserClient } from "../../user";
import { Requests } from "../../../requests";
function itemField(id = null): ItemField {
return {
id,
name: faker.lorem.word(),
type: "text",
textValue: faker.lorem.sentence(),
booleanValue: false,
numberValue: faker.datatype.number(),
timeValue: null,
};
}
/**
* Returns a random user registration object that can be
* used to signup a new user.
@ -72,6 +84,7 @@ export const factories = {
user,
location,
label,
itemField,
client: {
public: publicClient,
user: userClient,