remove depreciated calls

This commit is contained in:
Hayden 2023-11-15 15:15:50 -06:00
parent cb60f3d488
commit 94e7d98de6
No known key found for this signature in database
GPG key ID: 17CF79474E257545
5 changed files with 23 additions and 23 deletions

View file

@ -15,7 +15,7 @@ function itemField(id = null): ItemField {
type: "text", type: "text",
textValue: faker.lorem.sentence(), textValue: faker.lorem.sentence(),
booleanValue: false, booleanValue: false,
numberValue: faker.datatype.number(), numberValue: faker.number.int(),
timeValue: "", timeValue: "",
}; };
} }
@ -28,7 +28,7 @@ function user(): UserRegistration {
return { return {
email: faker.internet.email(), email: faker.internet.email(),
password: faker.internet.password(), password: faker.internet.password(),
name: faker.name.firstName(), name: faker.person.firstName(),
token: "", token: "",
}; };
} }
@ -36,7 +36,7 @@ function user(): UserRegistration {
function location(parentId: string | null = null): LocationCreate { function location(parentId: string | null = null): LocationCreate {
return { return {
parentId, parentId,
name: faker.address.city(), name: faker.location.city(),
description: faker.lorem.sentence(), description: faker.lorem.sentence(),
}; };
} }

View file

@ -8,7 +8,7 @@ describe("first time user workflow (register, login, join group)", () => {
test("user should be able to update group", async () => { test("user should be able to update group", async () => {
const { client } = await factories.client.singleUse(); const { client } = await factories.client.singleUse();
const name = faker.name.firstName(); const name = faker.person.firstName();
const { response, data: group } = await client.group.update({ const { response, data: group } = await client.group.update({
name, name,
@ -34,7 +34,7 @@ describe("first time user workflow (register, login, join group)", () => {
for (const currency of currencies) { for (const currency of currencies) {
const { response, data: group } = await client.group.update({ const { response, data: group } = await client.group.update({
name: faker.name.firstName(), name: faker.person.firstName(),
currency: currency.code, currency: currency.code,
}); });

View file

@ -135,9 +135,9 @@ describe("user should be able to create an item and add an attachment", () => {
const { response, data } = await api.items.maintenance.create(item.id, { const { response, data } = await api.items.maintenance.create(item.id, {
name: faker.vehicle.model(), name: faker.vehicle.model(),
description: faker.lorem.paragraph(1), description: faker.lorem.paragraph(1),
completedDate: faker.date.past(1), completedDate: faker.date.past(),
scheduledDate: "null", scheduledDate: "null",
cost: faker.datatype.number(100).toString(), cost: faker.number.int(100).toString(),
}); });
expect(response.status).toBe(201); expect(response.status).toBe(201);

View file

@ -8,8 +8,8 @@ describe("basic notifier workflows", () => {
// Create Notifier // Create Notifier
const result = await client.notifiers.create({ const result = await client.notifiers.create({
name: faker.name.firstName(), name: faker.person.firstName(),
url: "discord://" + faker.random.alphaNumeric(10), url: "discord://" + faker.string.alphanumeric(10),
isActive: true, isActive: true,
}); });
@ -22,8 +22,8 @@ describe("basic notifier workflows", () => {
// Update Notifier with new URL // Update Notifier with new URL
{ {
const updateData = { const updateData = {
name: faker.name.firstName(), name: faker.person.firstName(),
url: "discord://" + faker.random.alphaNumeric(10), url: "discord://" + faker.string.alphanumeric(10),
isActive: true, isActive: true,
}; };
@ -37,7 +37,7 @@ describe("basic notifier workflows", () => {
// Update Notifier with empty URL // Update Notifier with empty URL
{ {
const updateData = { const updateData = {
name: faker.name.firstName(), name: faker.person.firstName(),
url: null, url: null,
isActive: true, isActive: true,
}; };

View file

@ -40,8 +40,8 @@ function importFileGenerator(entries: number): ImportObj[] {
const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)]; const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];
const labels = faker.random.words(5).split(" ").join(";"); const labels = faker.word.words(5).split(" ").join(";");
const locations = faker.random.words(3).split(" "); const locations = faker.word.words(3).split(" ");
const half = Math.floor(entries / 2); const half = Math.floor(entries / 2);
@ -53,21 +53,21 @@ function importFileGenerator(entries: number): ImportObj[] {
[`HB.import_ref`]: faker.database.mongodbObjectId(), [`HB.import_ref`]: faker.database.mongodbObjectId(),
[`HB.location`]: pick(locations), [`HB.location`]: pick(locations),
[`HB.labels`]: labels, [`HB.labels`]: labels,
[`HB.quantity`]: Number(faker.random.numeric(2)), [`HB.quantity`]: Number(faker.number.int(2)),
[`HB.name`]: faker.random.words(3), [`HB.name`]: faker.word.words(3),
[`HB.description`]: "", [`HB.description`]: "",
[`HB.insured`]: faker.datatype.boolean(), [`HB.insured`]: faker.datatype.boolean(),
[`HB.serial_number`]: faker.random.alphaNumeric(5), [`HB.serial_number`]: faker.string.alphanumeric(5),
[`HB.model_number`]: faker.random.alphaNumeric(5), [`HB.model_number`]: faker.string.alphanumeric(5),
[`HB.manufacturer`]: faker.random.alphaNumeric(5), [`HB.manufacturer`]: faker.string.alphanumeric(5),
[`HB.notes`]: "", [`HB.notes`]: "",
[`HB.purchase_from`]: faker.name.fullName(), [`HB.purchase_from`]: faker.person.fullName(),
[`HB.purchase_price`]: faker.datatype.number(100), [`HB.purchase_price`]: faker.number.int(100),
[`HB.purchase_time`]: faker.date.past().toDateString(), [`HB.purchase_time`]: faker.date.past().toDateString(),
[`HB.lifetime_warranty`]: half > i, [`HB.lifetime_warranty`]: half > i,
[`HB.warranty_details`]: "", [`HB.warranty_details`]: "",
[`HB.sold_to`]: faker.name.fullName(), [`HB.sold_to`]: faker.person.fullName(),
[`HB.sold_price`]: faker.datatype.number(100), [`HB.sold_price`]: faker.number.int(100),
[`HB.sold_time`]: formatDate(faker.date.past()), [`HB.sold_time`]: formatDate(faker.date.past()),
[`HB.sold_notes`]: "", [`HB.sold_notes`]: "",
}); });