import { describe, expect, it } from 'vitest'; import { defaultLabelPrintConfig, parseLabelPrintConfigValue, } from '../src/services/weighStationLabelPrintConfigService'; describe('weighStationLabelPrintConfigService', () => { it('defaults: inbound off, picking on', () => { expect(defaultLabelPrintConfig('inbound')).toEqual({ enabled: false }); expect(defaultLabelPrintConfig('picking')).toEqual({ enabled: true }); }); it('parses missing / invalid as kind default', () => { expect(parseLabelPrintConfigValue(null, 'inbound')).toEqual({ enabled: false }); expect(parseLabelPrintConfigValue(undefined, 'picking')).toEqual({ enabled: true }); expect(parseLabelPrintConfigValue('x', 'inbound')).toEqual({ enabled: false }); expect(parseLabelPrintConfigValue({}, 'picking')).toEqual({ enabled: true }); }); it('parses boolean and { enabled }', () => { expect(parseLabelPrintConfigValue(true, 'inbound')).toEqual({ enabled: true }); expect(parseLabelPrintConfigValue(false, 'picking')).toEqual({ enabled: false }); expect(parseLabelPrintConfigValue({ enabled: true }, 'inbound')).toEqual({ enabled: true }); expect(parseLabelPrintConfigValue({ enabled: false }, 'picking')).toEqual({ enabled: false }); }); });