Skip to content

Commit

Permalink
test lockMargin and lockUnitPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Apr 11, 2024
1 parent dd9dbff commit 7f72305
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/workOrders.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import assert from 'node:assert';
import { randomUUID } from 'node:crypto';
import { after, describe, it } from 'node:test';
import { releaseAll } from '@cityssm/mssql-multi-pool';
import { addWorkOrderResource, getWorkOrderByWorkOrderNumber, getWorkOrderResourcesByWorkOrderNumber } from '../index.js';
Expand Down Expand Up @@ -31,9 +32,13 @@ await describe('queries/workOrders', async () => {
const resourcesBefore = await getWorkOrderResourcesByWorkOrderNumber(mssqlConfig, validWorkOrderNumber);
const systemId = await addWorkOrderResource(mssqlConfig, {
workOrderNumber: validWorkOrderNumber,
step: Math.round(Date.now() / 10_000).toString(),
itemId: validItemId,
workDescription: `${randomUUID().slice(-10)} - Item from Faster`,
quantity: 25,
unitPrice: 12.5
unitPrice: 12.5,
lockMargin: 1,
lockUnitPrice: 1
});
assert.ok(systemId !== undefined);
const resourcesAfter = await getWorkOrderResourcesByWorkOrderNumber(mssqlConfig, validWorkOrderNumber);
Expand Down
7 changes: 6 additions & 1 deletion test/workOrders.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import assert from 'node:assert'
import { randomUUID } from 'node:crypto'
import { after, describe, it } from 'node:test'

import { releaseAll } from '@cityssm/mssql-multi-pool'
Expand Down Expand Up @@ -66,9 +67,13 @@ await describe('queries/workOrders', async () => {

const systemId = await addWorkOrderResource(mssqlConfig, {
workOrderNumber: validWorkOrderNumber,
step: Math.round(Date.now() / 10_000).toString(),
itemId: validItemId,
workDescription: `${randomUUID().slice(-10)} - Item from Faster`,
quantity: 25,
unitPrice: 12.5
unitPrice: 12.5,
lockMargin: 1,
lockUnitPrice: 1
})

assert.ok(systemId !== undefined)
Expand Down

0 comments on commit 7f72305

Please sign in to comment.