24 lines
870 B
TypeScript
24 lines
870 B
TypeScript
import { describe, it } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { createEmptyStepOutputRow } from './production-step-output'
|
|
|
|
describe('createEmptyStepOutputRow', () => {
|
|
it('defaults barcode to lab storage code', () => {
|
|
const row = createEmptyStepOutputRow('LAB-001')
|
|
assert.equal(row.outputBarcode, 'LAB-001')
|
|
assert.equal(row.outputTypeId, '')
|
|
assert.equal(row.outputName, '')
|
|
assert.equal(row.remark, '')
|
|
})
|
|
|
|
it('trims lab storage code', () => {
|
|
assert.equal(createEmptyStepOutputRow(' LAB-002 ').outputBarcode, 'LAB-002')
|
|
})
|
|
|
|
it('uses empty barcode when lab storage code is missing', () => {
|
|
assert.equal(createEmptyStepOutputRow('').outputBarcode, '')
|
|
assert.equal(createEmptyStepOutputRow(null).outputBarcode, '')
|
|
assert.equal(createEmptyStepOutputRow(undefined).outputBarcode, '')
|
|
})
|
|
})
|